Class: Dina::Organization

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/dina/models/agent/organization.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

custom_headers, find_by_group, #initialize, properties, site

Constructor Details

This class inherits a constructor from Dina::BaseModel

Class Method Details

.endpoint_pathObject



14
15
16
# File 'lib/dina/models/agent/organization.rb', line 14

def self.endpoint_path
  "agent-api/"
end

.table_nameObject



18
19
20
# File 'lib/dina/models/agent/organization.rb', line 18

def self.table_name
  "organization"
end

Instance Method Details

#englishNameObject



27
28
29
# File 'lib/dina/models/agent/organization.rb', line 27

def englishName
  names.select{|o| o[:languageCode] == "EN"}.first[:name]
end

#englishName=(name) ⇒ Object



22
23
24
25
# File 'lib/dina/models/agent/organization.rb', line 22

def englishName=(name)
  names.delete_if{|o| o[:languageCode] == "EN"}
  names << { languageCode: "EN", name: name }
end

#frenchNameObject



36
37
38
# File 'lib/dina/models/agent/organization.rb', line 36

def frenchName
  names.select{|o| o[:languageCode] == "FR"}.first[:name]
end

#frenchName=(name) ⇒ Object



31
32
33
34
# File 'lib/dina/models/agent/organization.rb', line 31

def frenchName=(name)
  names.delete_if{|o| o[:languageCode] == "FR"}
  names << { languageCode: "FR", name: name }
end