Module: Ecoportal::API::Common::Content::DoubleModel::Attributable::Nesting::Keyable
- Extended by:
- Includer
- Defined in:
- lib/ecoportal/api/common/content/double_model/attributable/nesting/keyable.rb
Defined Under Namespace
Modules: ClassMethods Classes: NoKeyMethod
Instance Method Summary collapse
-
#key ⇒ String
The
valueof thekeymethod (i.e.idvalue). - #key=(value) ⇒ Object
Methods included from Includer
Instance Method Details
#key ⇒ String
Returns the value of the key method (i.e. id value).
67 68 69 70 71 72 |
# File 'lib/ecoportal/api/common/content/double_model/attributable/nesting/keyable.rb', line 67 def key msg = "No key_method defined for #{self.class}" raise NoKeyMethod, msg unless key_method? method(key_method).call end |
#key=(value) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/ecoportal/api/common/content/double_model/attributable/nesting/keyable.rb', line 75 def key=(value) msg = "No key_method defined for #{self.class}" raise NoKeyMethod, msg unless key_method? method("#{key_method}=").call(value) end |