Class: Strava::Cli::Console
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Strava::Cli::Console
- Defined in:
- lib/cli/console.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(access_token) ⇒ Console
constructor
A new instance of Console.
- #run(args) ⇒ Object
- #start! ⇒ Object
Constructor Details
#initialize(access_token) ⇒ Console
Returns a new instance of Console.
6 7 8 9 |
# File 'lib/cli/console.rb', line 6 def initialize(access_token) @client = Strava::Api::Client.new(access_token: access_token) super @client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/cli/console.rb', line 4 def client @client end |
Instance Method Details
#run(args) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/cli/console.rb', line 11 def run(args) args.map do |arg| rc = eval(arg) puts rc rc end end |
#start! ⇒ Object
19 20 21 |
# File 'lib/cli/console.rb', line 19 def start! Ripl.start(binding: binding, prompt: 'Strava> ') end |