Class: CLI
- Inherits:
-
Thor
- Object
- Thor
- CLI
- Defined in:
- lib/dscli/cli.rb
Instance Method Summary collapse
- #balance ⇒ Object
- #compile(csdl) ⇒ Object
- #config ⇒ Object
- #dpu(hash) ⇒ Object
- #stream(hash) ⇒ Object
- #usage(period = 'day') ⇒ Object
Instance Method Details
#balance ⇒ Object
41 42 43 44 |
# File 'lib/dscli/cli.rb', line 41 def balance api = Dscli::API.new puts api.balance end |
#compile(csdl) ⇒ Object
16 17 18 19 20 |
# File 'lib/dscli/cli.rb', line 16 def compile(csdl) api = Dscli::API.new definition = api.compile(csdl) puts definition end |
#config ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/dscli/cli.rb', line 7 def config input = Dscli::Parameters.new.user_config() puts input.to_yaml open(ENV['HOME'] + '/.datasiftcli', 'w') do |f| f.write input.to_yaml end end |
#dpu(hash) ⇒ Object
29 30 31 32 |
# File 'lib/dscli/cli.rb', line 29 def dpu(hash) api = Dscli::API.new puts Yajl::Encoder.encode(api.dpu(hash), :pretty => true) end |