Class: ITGlue::Client::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/itglue/client/mapper.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#formatObject



14
15
16
# File 'lib/itglue/client/mapper.rb', line 14

def format
  collection? ? format_collection(@raw_data) : format_object(@raw_data)
end