Class: LiveResource::RemoteMethodForward

Inherits:
Object
  • Object
show all
Defined in:
lib/live_resource/methods/forward.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource, method, params) ⇒ RemoteMethodForward

Returns a new instance of RemoteMethodForward.



7
8
9
10
11
12
# File 'lib/live_resource/methods/forward.rb', line 7

def initialize(resource, method, params)
  @resource = resource
  @method = method
  @params = params
  @next = nil
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



5
6
7
# File 'lib/live_resource/methods/forward.rb', line 5

def method
  @method
end

#nextObject (readonly)

Returns the value of attribute next.



5
6
7
# File 'lib/live_resource/methods/forward.rb', line 5

def next
  @next
end

#paramsObject (readonly)

Returns the value of attribute params.



5
6
7
# File 'lib/live_resource/methods/forward.rb', line 5

def params
  @params
end

#resourceObject (readonly)

Returns the value of attribute resource.



5
6
7
# File 'lib/live_resource/methods/forward.rb', line 5

def resource
  @resource
end

Instance Method Details

#continue(resource, method, *params) ⇒ Object



14
15
16
17
# File 'lib/live_resource/methods/forward.rb', line 14

def continue(resource, method, *params)
  @next = self.class.new(resource, method, params)
  self
end

#inspectObject



19
20
21
# File 'lib/live_resource/methods/forward.rb', line 19

def inspect
  "#{self.class}: #{@resource} #{@method} (#{@params.length} params)"
end