Class: FancyHash::Types::Array
- Inherits:
-
ActiveModel::Type::Value
- Object
- ActiveModel::Type::Value
- FancyHash::Types::Array
- Defined in:
- lib/fancy_hash.rb
Instance Attribute Summary collapse
-
#of ⇒ Object
readonly
Returns the value of attribute of.
Instance Method Summary collapse
-
#initialize(of: nil) ⇒ Array
constructor
A new instance of Array.
- #serialize(value) ⇒ Object
Constructor Details
#initialize(of: nil) ⇒ Array
Returns a new instance of Array.
78 79 80 81 82 |
# File 'lib/fancy_hash.rb', line 78 def initialize(of: nil) super() @of = of end |
Instance Attribute Details
#of ⇒ Object (readonly)
Returns the value of attribute of.
76 77 78 |
# File 'lib/fancy_hash.rb', line 76 def of @of end |
Instance Method Details
#serialize(value) ⇒ Object
84 85 86 |
# File 'lib/fancy_hash.rb', line 84 def serialize(value) value&.map { |v| Types.find(of).serialize(v) } end |