Module: Serega::Convert::ConvertInstanceMethods
- Included in:
- Serega::Convert
- Defined in:
- lib/serega/convert.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
12 13 14 |
# File 'lib/serega/convert.rb', line 12 def object @object end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
12 13 14 |
# File 'lib/serega/convert.rb', line 12 def opts @opts end |
Instance Method Details
#initialize(object, **opts) ⇒ Object
14 15 16 17 |
# File 'lib/serega/convert.rb', line 14 def initialize(object, **opts) @object = object @opts = opts end |
#to_h ⇒ Object
19 20 21 |
# File 'lib/serega/convert.rb', line 19 def to_h many? ? many(object) : one(object) || {} end |