Class: UnderFire::CLI
- Inherits:
-
Thor
- Object
- Thor
- UnderFire::CLI
- Includes:
- UnderFire
- Defined in:
- lib/under_fire/cli.rb
Overview
Command Line interface
Constant Summary
Constants included from UnderFire
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #album ⇒ Object
- #cover ⇒ Object
- #id ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #register ⇒ Object
- #toc ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
12 13 14 15 16 |
# File 'lib/under_fire/cli.rb', line 12 def initialize(*) super @config = Configuration.instance @client = Client.new() end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/under_fire/cli.rb', line 10 def client @client end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/under_fire/cli.rb', line 10 def config @config end |
Instance Method Details
#album ⇒ Object
41 42 43 |
# File 'lib/under_fire/cli.rb', line 41 def album say client.find_album() end |
#cover ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/under_fire/cli.rb', line 69 def cover say "Fetching cover" if [:verbose] url = [:url] file_name = [:file_name].empty? ? "cover.jpg" : [:file_name] APIRequest.get_file(url, file_name) say "saved #{file_name} in #{File.dirname __FILE__}" if [:verbose] end |
#id ⇒ Object
50 51 52 |
# File 'lib/under_fire/cli.rb', line 50 def id puts "Not implemented" end |
#register ⇒ Object
81 82 83 |
# File 'lib/under_fire/cli.rb', line 81 def register say client.register([:client_id]) end |
#toc ⇒ Object
24 25 26 |
# File 'lib/under_fire/cli.rb', line 24 def toc say client.find_by_toc([:offsets]) end |