Class: Prettys::Converter

Inherits:
Object show all
Defined in:
lib/converter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(format) ⇒ Converter

Returns a new instance of Converter.



13
14
15
# File 'lib/converter.rb', line 13

def initialize(format)
  self.format = format
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



3
4
5
# File 'lib/converter.rb', line 3

def format
  @format
end

Instance Method Details

#convert(object) ⇒ Object



22
23
24
# File 'lib/converter.rb', line 22

def convert(object)
  object.send(SUPPORTED_FORMATS[format])
end