Class: AppStoreConnect::Schema

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

Defined Under Namespace

Classes: Type, WebServiceEndpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Schema

Returns a new instance of Schema.



10
11
12
13
14
15
16
17
18
# File 'lib/app_store_connect/schema.rb', line 10

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 |s|
    WebServiceEndpoint.new(**s)
  end
end

Instance Attribute Details

#typesObject (readonly)

Returns the value of attribute types.



8
9
10
# File 'lib/app_store_connect/schema.rb', line 8

def types
  @types
end

#web_service_endpointsObject (readonly)

Returns the value of attribute web_service_endpoints.



8
9
10
# File 'lib/app_store_connect/schema.rb', line 8

def web_service_endpoints
  @web_service_endpoints
end