Module: PlasticWrap::CardboardTube::ClassMethods

Defined in:
lib/plastic_wrap/cardboard_tube.rb

Instance Method Summary collapse

Instance Method Details

#wrap(wrappable, options = {}) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/plastic_wrap/cardboard_tube.rb', line 36

def wrap(wrappable, options={})
  return wrappable if wrappable.instance_of? self

  if wrappable.respond_to?(:map)
    wrappable.map {|x| wrap(x, options) }
  else
    wrap_type(wrappable).new(wrappable, options)
  end
end

#wrap_type(wrappable) ⇒ Object



46
47
48
# File 'lib/plastic_wrap/cardboard_tube.rb', line 46

def wrap_type(wrappable)
  self
end