Class: WifiWand::Commands::Till
- Defined in:
- lib/wifi_wand/commands/till.rb
Constant Summary collapse
- STATES =
%w[wifi_on wifi_off associated disassociated internet_on internet_off].freeze
Constants inherited from Base
Base::DEFAULT_INVOCATION_OPTIONS
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#aliases, allow_invocation_options, allowed_invocation_options, #bind, binding_sources, binds, command_metadata, declared_metadata, #initialize, #validate_options
Constructor Details
This class inherits a constructor from WifiWand::Commands::Base
Instance Method Details
#call(*options) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/wifi_wand/commands/till.rb', line 42 def call(*) validate_presence!() validate_max_arguments!(, 3) target_status = [0].to_sym timeout_in_secs = parse_timeout([1]) interval_in_secs = parse_interval([2]) model.till( target_status, timeout_in_secs: timeout_in_secs, wait_interval_in_secs: interval_in_secs, stringify_permitted_values_in_error_msg: !interactive_mode ) end |
#help_text ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/wifi_wand/commands/till.rb', line 22 def help_text <<~HELP #{.usage} #{.description} States: wifi_on - WiFi hardware powered on wifi_off - WiFi hardware powered off associated - WiFi associated with an SSID disassociated - WiFi not associated with any SSID internet_on - Internet connectivity state is reachable internet_off - Internet connectivity state is unreachable Defaults: timeout = wait indefinitely interval = #{WifiWand::TimingConstants::DEFAULT_WAIT_INTERVAL} HELP end |