Class: BSClient::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bsclient/cli.rb

Instance Method Summary collapse

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(, text, size="30", color="red")
  req_content = {account: , text: text, fontSize: size, fontColor: color}.to_json
  app = App.new(options, Config.create(options[: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()
  params = {account: , imageName: ''}
  app = App.new(options, Config.create(options[: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, )
  app = App.new(options, Config.create(options[:env]))
  print app.query_registration(task_id, )
end

#register_account(filename = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/bsclient/cli.rb', line 12

def (filename = nil)
  req_content = if filename
                  IO.read(filename)
                else
                  STDIN.read
                end
  req_content = JSON.generate(JSON.parse(req_content))
  app = App.new(options, Config.create(options[:env]))
  print app.(req_content)
end