Class: HaveAPI::GoClient::ApiVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/haveapi/go_client/api_version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(desc) ⇒ ApiVersion

Returns a new instance of ApiVersion.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/haveapi/go_client/api_version.rb', line 12

def initialize(desc)
  @resources = desc[:resources].map do |k, v|
    Resource.new(self, k, v)
  end.sort!

  @resources.each(&:resolve_associations)

  @auth_methods = desc[:authentication].map do |k, v|
    AuthenticationMethods.new(self, k, v)
  end

  @metadata_namespace = desc[:meta][:namespace]
end

Instance Attribute Details

#auth_methodsArray<Authentication::Base> (readonly)

Returns:



4
5
6
# File 'lib/haveapi/go_client/api_version.rb', line 4

def auth_methods
  @auth_methods
end

#metadata_namespaceString (readonly)

Returns:

  • (String)


7
8
9
# File 'lib/haveapi/go_client/api_version.rb', line 7

def 
  @metadata_namespace
end

#resourcesArray<Resource> (readonly)

Returns:



10
11
12
# File 'lib/haveapi/go_client/api_version.rb', line 10

def resources
  @resources
end