Class: Deserializer::Attribute::Base
- Inherits:
-
Object
- Object
- Deserializer::Attribute::Base
- Defined in:
- lib/deserializer/attribute/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, opts = {}, object) ⇒ Base
constructor
A new instance of Base.
-
#to_hash(params) ⇒ Object
has_one :whatever; where def wahtever{ object } { object }.
Constructor Details
#initialize(name, opts = {}, object) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 |
# File 'lib/deserializer/attribute/base.rb', line 7 def initialize( name, opts = {}, object ) self.name = name self.opts = opts self.object = object end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/deserializer/attribute/base.rb', line 5 def name @name end |
Instance Method Details
#to_hash(params) ⇒ Object
has_one :whatever; where def wahtever{ object } { object }
21 22 23 24 |
# File 'lib/deserializer/attribute/base.rb', line 21 def to_hash( params ) return {} unless params.has_key? key tuple( params ) end |