class Smooth::DslProxy
Public Class Methods
new(current_user, api)
click to toggle source
# File lib/smooth/api.rb, line 292 def initialize(current_user, api) @current_user = current_user @api = api end
Public Instance Methods
i_would_like_to()
click to toggle source
# File lib/smooth/api.rb, line 297 def i_would_like_to self end
imll()
click to toggle source
# File lib/smooth/api.rb, line 305 def imll self end
lemme()
click to toggle source
# File lib/smooth/api.rb, line 301 def lemme self end
query(resource_name, *args)
click to toggle source
# File lib/smooth/api.rb, line 309 def query(resource_name, *args) params = args.extract_options! query_name = args.first || :default runner = @api.resource(resource_name).fetch(:query, query_name).as(@current_user) runner.async? ? perform_async(runner.object_path, params) : runner.run(params) end
run_command(resource_name, *args)
click to toggle source
# File lib/smooth/api.rb, line 316 def run_command(resource_name, *args) params = args.extract_options! command_name = args.first path = resource_name if command_name.nil? path = "#{ resource_name }.#{ command_name }" if command_name.present? runner = @api.lookup_object_by(path).as(@current_user) runner.async? ? perform_async(runner.object_path, params) : runner.run(params) end