Module: ModFactor::Owner::ClassMethods
- Defined in:
- lib/mod_factor/owner.rb
Instance Method Summary collapse
- #factor(name, options = {}) ⇒ Object
- #factor_define ⇒ Object
- #factors(model, options = {}) ⇒ Object
- #generate_list ⇒ Object
- #properties(model, options = {}) ⇒ Object
- #property(name, type, options = {}) ⇒ Object
- #property_define ⇒ Object
Instance Method Details
#factor(name, options = {}) ⇒ Object
93 94 95 96 |
# File 'lib/mod_factor/owner.rb', line 93 def factor name, = {} attr_accessor name factor_define[name] = end |
#factor_define ⇒ Object
102 103 104 |
# File 'lib/mod_factor/owner.rb', line 102 def factor_define @factor_define ||= {} end |
#factors(model, options = {}) ⇒ Object
87 88 89 90 91 |
# File 'lib/mod_factor/owner.rb', line 87 def factors model, = {} has_many model, :as=>:owner @factor_model = model yield if block_given? end |
#generate_list ⇒ Object
98 99 100 |
# File 'lib/mod_factor/owner.rb', line 98 def generate_list @generate_list ||= [] end |
#properties(model, options = {}) ⇒ Object
114 115 116 117 118 |
# File 'lib/mod_factor/owner.rb', line 114 def properties model, = {} has_many model, :as=>:owner @property_model = model yield if block_given? end |
#property(name, type, options = {}) ⇒ Object
120 121 122 123 124 |
# File 'lib/mod_factor/owner.rb', line 120 def property name, type, = {} attr_accessor name [:type] = type property_define[name] = end |
#property_define ⇒ Object
110 111 112 |
# File 'lib/mod_factor/owner.rb', line 110 def property_define @property_define ||= {} end |