Class: Prettys::Converter
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
Instance Method Summary collapse
- #convert(object) ⇒ Object
-
#initialize(format) ⇒ Converter
constructor
A new instance of Converter.
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
#format ⇒ Object
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 |