Module: LunaPark::Extensions::Wrappable
- Included in:
- LunaPark::Entities::Simple, Values::Compound
- Defined in:
- lib/luna_park/extensions/wrappable.rb
Overview
class-level mixin
Instance Method Summary collapse
Instance Method Details
#wrap(input) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/luna_park/extensions/wrappable.rb', line 33 def wrap(input) case input when self then input when Hash then new(input) when nil then nil else raise Errors::Unwrapable, "#{self} can not wrap #{input.class}" end end |