Module: DynamicActiveResource::CommonDynamicClassInstanceMethods
- Defined in:
- lib/dynamic_active_resource/common_dynamic_class_instance_methods.rb
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_symbol, *arguments) ⇒ Object
:nodoc:
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/dynamic_active_resource/common_dynamic_class_instance_methods.rb', line 3 def method_missing(method_symbol, *arguments) #:nodoc: method_name = method_symbol.to_s # dynamic setters and getters case method_name.last when "=" return attributes[method_name.first(-1)] = arguments.first when "?" return attributes[method_name.first(-1)] else # return attributes return attributes[method_name] if(attributes.has_key?(method_name)) # return the association if it is a association method return get_association(method_name) if(association_method?(method_name)) super end end |
Instance Method Details
#resource_identifier ⇒ Object
20 21 22 |
# File 'lib/dynamic_active_resource/common_dynamic_class_instance_methods.rb', line 20 def resource_identifier id() end |