Class: Asdawqw::InternetPolicy

Inherits:
BaseModel show all
Defined in:
lib/asdawqw/models/internet_policy.rb

Overview

InternetPolicy Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(access_internet = nil, kind_of_internet = nil, available_internet = nil, charge_internet = nil) ⇒ InternetPolicy

Returns a new instance of InternetPolicy.



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

def initialize(access_internet = nil,
               kind_of_internet = nil,
               available_internet = nil,
               charge_internet = nil)
  @access_internet = access_internet
  @kind_of_internet = kind_of_internet
  @available_internet = available_internet
  @charge_internet = charge_internet
end

Instance Attribute Details

#access_internetBoolean

Access internet into properties

Returns:

  • (Boolean)


11
12
13
# File 'lib/asdawqw/models/internet_policy.rb', line 11

def access_internet
  @access_internet
end

#available_internetAvailableInternetEnum

Available internet BusinessCenter, SomeRooms



19
20
21
# File 'lib/asdawqw/models/internet_policy.rb', line 19

def available_internet
  @available_internet
end

#charge_internetString

Charge internet. Example: “Free”, “$ 100”.

Returns:



23
24
25
# File 'lib/asdawqw/models/internet_policy.rb', line 23

def charge_internet
  @charge_internet
end

#kind_of_internetKindOfInternetTypeEnum

Kind of Internet Wired



15
16
17
# File 'lib/asdawqw/models/internet_policy.rb', line 15

def kind_of_internet
  @kind_of_internet
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/asdawqw/models/internet_policy.rb', line 46

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  access_internet = hash['accessInternet']
  kind_of_internet = hash['kindOfInternet']
  available_internet = hash['availableInternet']
  charge_internet = hash['chargeInternet']

  # Create object from extracted values.
  InternetPolicy.new(access_internet,
                     kind_of_internet,
                     available_internet,
                     charge_internet)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['access_internet'] = 'accessInternet'
  @_hash['kind_of_internet'] = 'kindOfInternet'
  @_hash['available_internet'] = 'availableInternet'
  @_hash['charge_internet'] = 'chargeInternet'
  @_hash
end