Class: Send2MacClient::Runner
- Inherits:
-
Object
- Object
- Send2MacClient::Runner
- Defined in:
- lib/send2mac/runner.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #config_path ⇒ Object
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #setup_api_key ⇒ Object
Constructor Details
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
8 9 10 |
# File 'lib/send2mac/runner.rb', line 8 def client @client end |
Instance Method Details
#config_path ⇒ Object
16 17 18 |
# File 'lib/send2mac/runner.rb', line 16 def config_path File.("#{ENV['HOME']}/.send2mac", __FILE__) end |
#run ⇒ Object
31 32 33 |
# File 'lib/send2mac/runner.rb', line 31 def run client.listen end |
#setup_api_key ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/send2mac/runner.rb', line 20 def setup_api_key say("\nPlease enter your Send2Mac API Key") puts "" key = ask("API Key: ") this = {api_key: key.to_s} File.open(config_path, "w") do |f| f.write(this.to_yaml) end @config = YAML.load_file(config_path) end |