Class: RiceBubble::Attributes::Serialized
- Defined in:
- lib/rice_bubble/attributes/serialized.rb
Instance Attribute Summary collapse
-
#serializer ⇒ Object
readonly
Returns the value of attribute serializer.
Instance Method Summary collapse
- #call(value, path: '') ⇒ Object
-
#initialize(serializer) ⇒ Serialized
constructor
A new instance of Serialized.
- #valid?(value) ⇒ Boolean
Methods inherited from Base
#description, #fetch, #optional, #valid_types
Constructor Details
#initialize(serializer) ⇒ Serialized
Returns a new instance of Serialized.
6 7 8 9 |
# File 'lib/rice_bubble/attributes/serialized.rb', line 6 def initialize(serializer, &) super(&) @serializer = serializer end |
Instance Attribute Details
#serializer ⇒ Object (readonly)
Returns the value of attribute serializer.
4 5 6 |
# File 'lib/rice_bubble/attributes/serialized.rb', line 4 def serializer @serializer end |
Instance Method Details
#call(value, path: '') ⇒ Object
15 16 17 |
# File 'lib/rice_bubble/attributes/serialized.rb', line 15 def call(value, path: '') serializer.call(value, path:) end |
#valid?(value) ⇒ Boolean
11 12 13 |
# File 'lib/rice_bubble/attributes/serialized.rb', line 11 def valid?(value) serializer.valid?(value) end |