Class: Netzke::Railz::ControllerExtensions::DirectRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/netzke/core/railz/controller_extensions.rb

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ DirectRequest

Returns a new instance of DirectRequest



6
7
8
# File 'lib/netzke/core/railz/controller_extensions.rb', line 6

def initialize(params)
  @params = params
end

Instance Method Details

#argsObject

arguments for endpoint call



19
20
21
22
# File 'lib/netzke/core/railz/controller_extensions.rb', line 19

def args
  res = remoting_args.has_key?("args") ? remoting_args["args"] : remoting_args
  res.is_a?(Array) ? res : [res].compact # need to wrap into array to normalize
end

#client_configsObject



24
25
26
# File 'lib/netzke/core/railz/controller_extensions.rb', line 24

def client_configs
  remoting_args["configs"] || []
end

#cmp_pathObject



10
11
12
# File 'lib/netzke/core/railz/controller_extensions.rb', line 10

def cmp_path
  @params[:path]
end

#endpointObject



14
15
16
# File 'lib/netzke/core/railz/controller_extensions.rb', line 14

def endpoint
  @params[:endpoint].underscore
end

#tidObject



28
29
30
# File 'lib/netzke/core/railz/controller_extensions.rb', line 28

def tid
  @params[:tid]
end