Module: VarBlock::Support
- Included in:
- GetvarHandlers::VarArrayHandler, VarHash
- Defined in:
- lib/var_block/support.rb
Instance Method Summary collapse
-
#array_wrap(object) ⇒ Object
copied directly from Rails Array class apidock.com/rails/v4.2.7/Array/wrap/class.
Instance Method Details
#array_wrap(object) ⇒ Object
copied directly from Rails Array class apidock.com/rails/v4.2.7/Array/wrap/class
5 6 7 8 9 10 11 12 13 |
# File 'lib/var_block/support.rb', line 5 def array_wrap(object) if object.nil? [] elsif object.respond_to?(:to_ary) object.to_ary || [object] else [object] end end |