Class: Hsp::Cli::Platforms
- Inherits:
-
Thor
- Object
- Thor
- Hsp::Cli::Platforms
- Defined in:
- lib/hsp/cli/platforms.rb
Instance Method Summary collapse
Instance Method Details
#list ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/hsp/cli/platforms.rb', line 28 def list m = Marketplace.new query = { page: 1, per_page: 10 } query[:page] = [:page].to_i if [:page] query[:per_page] = [:per_page].to_i if [:per_page] response = HTTParty.get(m.platforms_url([:user_id]), query: query, headers: Hsp::Client.headers) json = JSON.parse(response.body) # puts json print_platforms(json) end |
#show ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/hsp/cli/platforms.rb', line 45 def show m = Marketplace.new response = HTTParty.get(m.platforms_url([:user_id], [:platform_id]), headers: Hsp::Client.headers) json = JSON.parse(response.body) # puts json puts '' puts json['name'] # puts json['description'] puts "ID: #{json['id']}" puts "Owner (User ID): #{json['user_id']}" puts "Secret: #{json['public_key']}" puts "Created: #{json['created_at']}" puts "Updated: #{json['updated_at']}" puts "URL: #{json['url']}" puts "Path: #{json['path']}" puts '' end |