Class: Decoradar::Collection
- Defined in:
- lib/decoradar/collection.rb
Instance Attribute Summary collapse
-
#serializer ⇒ Object
readonly
Returns the value of attribute serializer.
Attributes inherited from Attribute
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Collection
constructor
A new instance of Collection.
- #serialize(hash, collection) ⇒ Object
Methods inherited from Attribute
Constructor Details
#initialize(options = {}) ⇒ Collection
5 6 7 8 |
# File 'lib/decoradar/collection.rb', line 5 def initialize( = {}) super() @serializer = .fetch(:serializer) end |
Instance Attribute Details
#serializer ⇒ Object (readonly)
Returns the value of attribute serializer.
3 4 5 |
# File 'lib/decoradar/collection.rb', line 3 def serializer @serializer end |
Instance Method Details
#serialize(hash, collection) ⇒ Object
10 11 12 |
# File 'lib/decoradar/collection.rb', line 10 def serialize(hash, collection) hash.merge(as => _serialize(collection)) end |