Module: PlasticWrap::CardboardTube::ClassMethods

Defined in:
lib/plastic_wrap/cardboard_tube.rb

Instance Method Summary collapse

Instance Method Details

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



42
43
44
45
46
47
48
49
50
# File 'lib/plastic_wrap/cardboard_tube.rb', line 42

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



52
53
54
# File 'lib/plastic_wrap/cardboard_tube.rb', line 52

def wrap_type(wrappable)
  self
end