Class: ShellEv::Accessibility

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_ev/models/accessibility.rb

Overview

Accessibility of the Location

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(status = SKIP, remark = SKIP) ⇒ Accessibility

Returns a new instance of Accessibility.



41
42
43
44
# File 'lib/shell_ev/models/accessibility.rb', line 41

def initialize(status = SKIP, remark = SKIP)
  @status = status unless status == SKIP
  @remark = remark unless remark == SKIP
end

Instance Attribute Details

#remarkString

optional Arbitrary text about restrictions of the Location

Returns:

  • (String)


18
19
20
# File 'lib/shell_ev/models/accessibility.rb', line 18

def remark
  @remark
end

#statusAccessibilityStatusEnum

Accessibility Status



14
15
16
# File 'lib/shell_ev/models/accessibility.rb', line 14

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/shell_ev/models/accessibility.rb', line 47

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : SKIP
  remark = hash.key?('remark') ? hash['remark'] : SKIP

  # Create object from extracted values.
  Accessibility.new(status,
                    remark)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/shell_ev/models/accessibility.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['remark'] = 'remark'
  @_hash
end

.nullablesObject

An array for nullable fields



37
38
39
# File 'lib/shell_ev/models/accessibility.rb', line 37

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
34
# File 'lib/shell_ev/models/accessibility.rb', line 29

def self.optionals
  %w[
    status
    remark
  ]
end