Class: OneSky::Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/one_sky/platform.rb

Overview

Implements the Platform Management API for a given :platform_id

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(platform_id, client) ⇒ Platform

Provide the id of the platform, together with an instance of OneSky::Client.



9
10
11
12
# File 'lib/one_sky/platform.rb', line 9

def initialize(platform_id, client)
  @platform_id = platform_id
  @client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



6
7
8
# File 'lib/one_sky/platform.rb', line 6

def client
  @client
end

#platform_idObject

Returns the value of attribute platform_id.



6
7
8
# File 'lib/one_sky/platform.rb', line 6

def platform_id
  @platform_id
end

Instance Method Details

#detailsObject

Get the information of the platform.



15
16
17
# File 'lib/one_sky/platform.rb', line 15

def details
  get("platform/details")["platform"]
end

#localesObject

Get the details of activated locales for a platform.



20
21
22
# File 'lib/one_sky/platform.rb', line 20

def locales
  get("platform/locales")["locales"]
end

#translationObject

Returns an API proxy for the Translation I/O API for this platform



25
26
27
# File 'lib/one_sky/platform.rb', line 25

def translation
  Translation.new(platform_id, client)
end