Class: AppStoreDevApi::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/app_store_dev_api/schema.rb,
lib/app_store_dev_api/schema/type.rb,
lib/app_store_dev_api/schema/object.rb,
lib/app_store_dev_api/schema/web_service_endpoint.rb

Defined Under Namespace

Classes: Object, Type, WebServiceEndpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Schema

Returns a new instance of Schema.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/app_store_dev_api/schema.rb', line 11

def initialize(path)
  schema = JSON.parse(File.read(path)).deep_symbolize_keys
  @types = schema[:types].map do |options|
    Type.new(options)
  end
  @web_service_endpoints = schema[:web_service_endpoints].map do |options|
    WebServiceEndpoint.new(options)
  end
  @objects = schema[:objects].map do |options|
    Object.new(options)
  end
end

Instance Attribute Details

#objectsObject (readonly)

Returns the value of attribute objects.



9
10
11
# File 'lib/app_store_dev_api/schema.rb', line 9

def objects
  @objects
end

#typesObject (readonly)

Returns the value of attribute types.



9
10
11
# File 'lib/app_store_dev_api/schema.rb', line 9

def types
  @types
end

#web_service_endpointsObject (readonly)

Returns the value of attribute web_service_endpoints.



9
10
11
# File 'lib/app_store_dev_api/schema.rb', line 9

def web_service_endpoints
  @web_service_endpoints
end