Class: Layer::SingletonRelationProxy

Inherits:
RelationProxy show all
Includes:
Operations::Fetch, Operations::Fetch::ClassMethods
Defined in:
lib/layer/singleton_relation_proxy.rb

Instance Attribute Summary

Attributes inherited from RelationProxy

#base, #resource_type

Instance Method Summary collapse

Methods included from Operations::Fetch

#reload

Methods included from Operations::Fetch::ClassMethods

#fetch

Methods inherited from RelationProxy

#client, #each, #initialize, #url

Constructor Details

This class inherits a constructor from Layer::RelationProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



16
17
18
19
20
21
22
# File 'lib/layer/singleton_relation_proxy.rb', line 16

def method_missing(method, *args, &block)
  if resource.respond_to?(method)
    resource.public_send(method, *args, &block)
  else
    super
  end
end

Instance Method Details

#from_response(*args) ⇒ Object



10
11
12
# File 'lib/layer/singleton_relation_proxy.rb', line 10

def from_response(*args)
  resource_type.from_response(*args)
end

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/layer/singleton_relation_proxy.rb', line 6

def respond_to_missing?(method, include_private = false)
  resource.respond_to?(method, include_private) || super
end