Method: Patchboard::API#initialize

Defined in:
lib/patchboard/api.rb

#initialize(definition) ⇒ API

Returns a new instance of API.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/patchboard/api.rb', line 7

def initialize(definition)

  @service_url = definition[:service_url]
  @resources = Hashie::Mash.new definition[:resources]
  @resources.each do |name, definition|
    definition.name = name
  end
  @schemas = definition[:schemas]

  @mappings = {}
  definition[:mappings].each do |name, mapping|
    @mappings[name] = Mapping.new(self, name, mapping)
  end
end