Class: Utusemi::Definition
- Inherits:
-
Object
- Object
- Utusemi::Definition
- Defined in:
- lib/utusemi/definition.rb
Constant Summary collapse
- UNPROXIED_METHODS =
%w(__send__ __id__ nil? send object_id extend instance_eval initialize block_given? raise caller method instance_exec)
- OPTION_METHODS =
%w(class_name foreign_key)
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #exec(*args, &block) ⇒ Object
-
#initialize(options = {}) ⇒ Definition
constructor
A new instance of Definition.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Definition
Returns a new instance of Definition.
16 17 18 19 |
# File 'lib/utusemi/definition.rb', line 16 def initialize( = {}) @attributes = {} @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
26 27 28 |
# File 'lib/utusemi/definition.rb', line 26 def method_missing(name, *args) add_attribute(name, *args) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
14 15 16 |
# File 'lib/utusemi/definition.rb', line 14 def attributes @attributes end |
Instance Method Details
#exec(*args, &block) ⇒ Object
21 22 23 24 |
# File 'lib/utusemi/definition.rb', line 21 def exec(*args, &block) instance_exec(*args, &block) if block_given? self end |