Class: DynamicActiveResource::Associations::Base
- Inherits:
-
Object
- Object
- DynamicActiveResource::Associations::Base
- Defined in:
- lib/dynamic_active_resource/associations/base.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
Instance Method Summary collapse
-
#initialize(method_name, options = {}) ⇒ Base
constructor
A new instance of Base.
-
#resources_for(caller) ⇒ Object
fetches the resources for the association.
Constructor Details
#initialize(method_name, options = {}) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 |
# File 'lib/dynamic_active_resource/associations/base.rb', line 5 def initialize(method_name, = {}) @method_name = method_name.to_s class_name = [:through] || @method_name.singularize.camelize @associated_class_name = class_name end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
4 5 6 |
# File 'lib/dynamic_active_resource/associations/base.rb', line 4 def method_name @method_name end |
Instance Method Details
#resources_for(caller) ⇒ Object
fetches the resources for the association. requires the caller to be passed through self.
13 14 15 |
# File 'lib/dynamic_active_resource/associations/base.rb', line 13 def resources_for(caller) raise 'Not Implemented' end |