Class: TestPack1::ClientConfiguration

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/test_pack_1/models/client_configuration.rb

Overview

General configuration data.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(title = nil, tag = nil, url_web = nil, url_api = nil) ⇒ ClientConfiguration

Returns a new instance of ClientConfiguration.



35
36
37
38
39
40
41
42
43
# File 'lib/test_pack_1/models/client_configuration.rb', line 35

def initialize(title = nil,
               tag = nil,
               url_web = nil,
               url_api = nil)
  @title = title
  @tag = tag
  @url_web = url_web
  @url_api = url_api
end

Instance Attribute Details

#tagString

Your internal customer tag.

Returns:



15
16
17
# File 'lib/test_pack_1/models/client_configuration.rb', line 15

def tag
  @tag
end

#titleString

The title of your Greenbyte Platform website.

Returns:



11
12
13
# File 'lib/test_pack_1/models/client_configuration.rb', line 11

def title
  @title
end

#url_apiString

Your URL to access the Greenbyte Platform API.

Returns:



23
24
25
# File 'lib/test_pack_1/models/client_configuration.rb', line 23

def url_api
  @url_api
end

#url_webString

Your URL to access the Greenbyte Platform website.

Returns:



19
20
21
# File 'lib/test_pack_1/models/client_configuration.rb', line 19

def url_web
  @url_web
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/test_pack_1/models/client_configuration.rb', line 46

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  title = hash['title']
  tag = hash['tag']
  url_web = hash['urlWeb']
  url_api = hash['urlApi']

  # Create object from extracted values.
  ClientConfiguration.new(title,
                          tag,
                          url_web,
                          url_api)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
33
# File 'lib/test_pack_1/models/client_configuration.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['title'] = 'title'
  @_hash['tag'] = 'tag'
  @_hash['url_web'] = 'urlWeb'
  @_hash['url_api'] = 'urlApi'
  @_hash
end