Class: ITGlue::Client::Mapper
- Inherits:
-
Object
- Object
- ITGlue::Client::Mapper
- Defined in:
- lib/itglue/client/mapper.rb
Class Method Summary collapse
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(raw_data) ⇒ Mapper
constructor
A new instance of Mapper.
Constructor Details
#initialize(raw_data) ⇒ Mapper
Returns a new instance of Mapper.
10 11 12 |
# File 'lib/itglue/client/mapper.rb', line 10 def initialize(raw_data) @raw_data = raw_data end |
Class Method Details
.map(raw_data) ⇒ Object
6 7 8 |
# File 'lib/itglue/client/mapper.rb', line 6 def self.map(raw_data) self.new(raw_data).format end |
Instance Method Details
#format ⇒ Object
14 15 16 |
# File 'lib/itglue/client/mapper.rb', line 14 def format collection? ? format_collection(@raw_data) : format_object(@raw_data) end |