Class: WifiWand::Platforms::Mac::Helper::Bundle::HelperQueryResult
- Inherits:
-
Struct
- Object
- Struct
- WifiWand::Platforms::Mac::Helper::Bundle::HelperQueryResult
- Defined in:
- lib/wifi_wand/platforms/mac/helper/client.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#location_services_blocked ⇒ Object
Returns the value of attribute location_services_blocked.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#signal_quality ⇒ Object
Returns the value of attribute signal_quality.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #ambiguous? ⇒ Boolean
- #connected? ⇒ Boolean
-
#initialize(payload: nil, location_services_blocked: nil, error_message: nil, signal_quality: nil, status: nil) ⇒ HelperQueryResult
constructor
A new instance of HelperQueryResult.
- #location_services_blocked? ⇒ Boolean
- #location_services_error? ⇒ Boolean
- #not_connected? ⇒ Boolean
- #permission_denied? ⇒ Boolean
Constructor Details
#initialize(payload: nil, location_services_blocked: nil, error_message: nil, signal_quality: nil, status: nil) ⇒ HelperQueryResult
Returns a new instance of HelperQueryResult.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 36 def initialize(payload: nil, location_services_blocked: nil, error_message: nil, signal_quality: nil, status: nil) result_status = status || default_status( location_services_blocked: location_services_blocked, error_message: ) unless HELPER_QUERY_STATUSES.include?(result_status) raise ArgumentError, "unknown helper query status: #{result_status.inspect}" end blocked = location_services_blocked || LOCATION_SERVICES_BLOCKING_STATUSES.include?(result_status) super( payload: payload, location_services_blocked: blocked, error_message: , signal_quality: signal_quality, status: result_status ) end |
Instance Attribute Details
#error_message ⇒ Object
Returns the value of attribute error_message
28 29 30 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 28 def @error_message end |
#location_services_blocked ⇒ Object
Returns the value of attribute location_services_blocked
28 29 30 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 28 def location_services_blocked @location_services_blocked end |
#payload ⇒ Object
Returns the value of attribute payload
28 29 30 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 28 def payload @payload end |
#signal_quality ⇒ Object
Returns the value of attribute signal_quality
28 29 30 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 28 def signal_quality @signal_quality end |
#status ⇒ Object
Returns the value of attribute status
28 29 30 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 28 def status @status end |
Instance Method Details
#ambiguous? ⇒ Boolean
64 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 64 def ambiguous? = AMBIGUOUS_HELPER_QUERY_STATUSES.include?(status) |
#connected? ⇒ Boolean
60 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 60 def connected? = status == :connected |
#location_services_blocked? ⇒ Boolean
58 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 58 def location_services_blocked? = !!location_services_blocked |
#location_services_error? ⇒ Boolean
68 69 70 71 72 73 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 68 def location_services_error? return true if location_services_blocked? return false if .to_s.empty? .downcase.include?('location services') end |
#not_connected? ⇒ Boolean
62 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 62 def not_connected? = status == :not_connected |
#permission_denied? ⇒ Boolean
66 |
# File 'lib/wifi_wand/platforms/mac/helper/client.rb', line 66 def = status == :permission_denied |