Class: BSClient::CLI
- Inherits:
-
Thor
- Object
- Thor
- BSClient::CLI
- Defined in:
- lib/bsclient/cli.rb
Instance Method Summary collapse
- #create_user_image(account, text, size = "30", color = "red") ⇒ Object
- #download_user_image(account) ⇒ Object
- #query_registration(task_id, account) ⇒ Object
- #register_account(filename = nil) ⇒ Object
Instance Method Details
#create_user_image(account, text, size = "30", color = "red") ⇒ Object
30 31 32 33 34 |
# File 'lib/bsclient/cli.rb', line 30 def create_user_image(account, text, size="30", color="red") req_content = {account: account, text: text, fontSize: size, fontColor: color}.to_json app = App.new(, Config.create([:env])) print app.create_user_image(req_content) end |
#download_user_image(account) ⇒ Object
37 38 39 40 41 |
# File 'lib/bsclient/cli.rb', line 37 def download_user_image(account) params = {account: account, imageName: ''} app = App.new(, Config.create([:env])) print app.download_user_image(params) end |
#query_registration(task_id, account) ⇒ Object
24 25 26 27 |
# File 'lib/bsclient/cli.rb', line 24 def query_registration(task_id, account) app = App.new(, Config.create([:env])) print app.query_registration(task_id, account) end |
#register_account(filename = nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bsclient/cli.rb', line 12 def register_account(filename = nil) req_content = if filename IO.read(filename) else STDIN.read end req_content = JSON.generate(JSON.parse(req_content)) app = App.new(, Config.create([:env])) print app.register_account(req_content) end |