class Klimt::Command
Public Instance Methods
count(type, *params)
click to toggle source
# File lib/klimt/command.rb, line 32 def count(type, *params) client = GravityClient.new(env: options[:env]) count = client.count(type: type, params: params) puts count end
find(type, id)
click to toggle source
# File lib/klimt/command.rb, line 18 def find(type, id) client = GravityClient.new(env: options[:env]) response = client.find(type: type, id: id) render response end
list(type, *params)
click to toggle source
# File lib/klimt/command.rb, line 25 def list(type, *params) client = GravityClient.new(env: options[:env]) response = client.list(type: type, params: params) render response end
search(term, *params)
click to toggle source
# File lib/klimt/command.rb, line 42 def search(term, *params) if options[:lucky] params << 'size=1' jq_filter = '.[0] | { model, id, display }' end indexes = options[:indexes] unless options[:indexes].nil? client = GravityClient.new(env: options[:env]) response = client.search(term: term, params: params, indexes: indexes) render response, jq_filter: jq_filter end
version()
click to toggle source
# File lib/klimt/command.rb, line 55 def version puts Klimt::VERSION end