Sha256: e01e9dbf11ff54599a47a9518a422fa777b0f9853162e3d9ba9c427b5d3f3811

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

class AccessPointList
  include WpaCliRuby

  def initialize(cli_client = WpaCli.new)
    cli_client.scan
    @access_points = cli_client.scan_results
  end

  def access_points
    @access_points.
      group_by {|network| network.ssid}.
      map {|ssid, network_group| network_group}.
      map {|network_group| network_group.sort_by { |network| network.signal_level}.reverse.take(1)}.
      flatten.
      sort_by { |network| network.ssid }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wpa_cli_web-0.0.7 lib/wpa_cli_web/access_point_list.rb