Class: EasySerializer::Collection
- Defined in:
- lib/easy_serializer/collection.rb
Instance Attribute Summary collapse
-
#_options ⇒ Object
readonly
Returns the value of attribute _options.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options, block) ⇒ Collection
constructor
A new instance of Collection.
- #options ⇒ Object
- #received_opts ⇒ Object
Methods inherited from Field
#cache_key, #cache_options, #catch?, #get_value, #nested_serializer, #send_method, #serialize!, #serializer, #serializer?
Methods included from Helpers
Constructor Details
#initialize(name, options, block) ⇒ Collection
Returns a new instance of Collection.
4 5 6 7 8 |
# File 'lib/easy_serializer/collection.rb', line 4 def initialize(name, , block) @name = name @_options = @block = block end |
Instance Attribute Details
#_options ⇒ Object (readonly)
Returns the value of attribute _options.
3 4 5 |
# File 'lib/easy_serializer/collection.rb', line 3 def @_options end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/easy_serializer/collection.rb', line 3 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/easy_serializer/collection.rb', line 3 def name @name end |
Instance Method Details
#options ⇒ Object
10 11 12 |
# File 'lib/easy_serializer/collection.rb', line 10 def received_opts.merge(collection: true) end |
#received_opts ⇒ Object
14 15 16 |
# File 'lib/easy_serializer/collection.rb', line 14 def received_opts || {} end |