Class: Lobbyliste::Organisation
- Defined in:
- lib/lobbyliste/organisation.rb
Overview
Class to encapsulate an organisation
Instance Attribute Summary collapse
-
#abbreviations ⇒ Array
readonly
List of abbreviations.
-
#additional_address ⇒ Lobbyliste::Address
readonly
The address stated under “Weitere Addresse”.
-
#address ⇒ Lobbyliste::Address
readonly
The primary Address of the organisation.
-
#address_at_bt_br ⇒ Lobbyliste::Address
readonly
The address stated under “Anschrift am Sitz von BT und BRg”.
-
#associated_organisations ⇒ Integer
readonly
Number of associated organisations as stated under “Anzahl der angeschlossenen Organisationen”.
-
#id ⇒ Integer
readonly
The organisation id of the organisation.
-
#interests ⇒ String
readonly
Interests as stated under “Interessenbereich”.
-
#members ⇒ Integer
readonly
Number of members as stated under “Mitgleiderzahl”.
-
#name ⇒ String
readonly
The organisations name.
-
#people ⇒ Array
readonly
List of Person which includes all members stated under “Vorstand und Geschäftsführung” and “Verbandsvertreter/-innen”.
-
#tags ⇒ Array
readonly
List of tags.
Instance Method Summary collapse
-
#addresses ⇒ Array
List of all known addresses.
-
#initialize(id, name, address, additional_address, address_at_bt_br, people, interests, members, associated_organisations, tags, abbreviations) ⇒ Organisation
constructor
A new instance of Organisation.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(id, name, address, additional_address, address_at_bt_br, people, interests, members, associated_organisations, tags, abbreviations) ⇒ Organisation
Returns a new instance of Organisation.
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/lobbyliste/organisation.rb', line 38 def initialize(id, name, address, additional_address, address_at_bt_br, people, interests, members, associated_organisations,,abbreviations) @id = id @name = name @address = address @additional_address = additional_address @address_at_bt_br = address_at_bt_br @people = people @interests = interests @members = members @associated_organisations = associated_organisations = @abbreviations = abbreviations end |
Instance Attribute Details
#abbreviations ⇒ Array (readonly)
Returns list of abbreviations.
36 37 38 |
# File 'lib/lobbyliste/organisation.rb', line 36 def abbreviations @abbreviations end |
#additional_address ⇒ Lobbyliste::Address (readonly)
Returns the address stated under “Weitere Addresse”.
15 16 17 |
# File 'lib/lobbyliste/organisation.rb', line 15 def additional_address @additional_address end |
#address ⇒ Lobbyliste::Address (readonly)
Returns the primary Address of the organisation.
12 13 14 |
# File 'lib/lobbyliste/organisation.rb', line 12 def address @address end |
#address_at_bt_br ⇒ Lobbyliste::Address (readonly)
Returns the address stated under “Anschrift am Sitz von BT und BRg”.
18 19 20 |
# File 'lib/lobbyliste/organisation.rb', line 18 def address_at_bt_br @address_at_bt_br end |
#associated_organisations ⇒ Integer (readonly)
Returns number of associated organisations as stated under “Anzahl der angeschlossenen Organisationen”.
30 31 32 |
# File 'lib/lobbyliste/organisation.rb', line 30 def associated_organisations @associated_organisations end |
#id ⇒ Integer (readonly)
Returns the organisation id of the organisation. This number is not fix and may change with every new document version.
6 7 8 |
# File 'lib/lobbyliste/organisation.rb', line 6 def id @id end |
#interests ⇒ String (readonly)
Returns interests as stated under “Interessenbereich”.
24 25 26 |
# File 'lib/lobbyliste/organisation.rb', line 24 def interests @interests end |
#members ⇒ Integer (readonly)
Returns number of members as stated under “Mitgleiderzahl”.
27 28 29 |
# File 'lib/lobbyliste/organisation.rb', line 27 def members @members end |
#name ⇒ String (readonly)
Returns the organisations name.
9 10 11 |
# File 'lib/lobbyliste/organisation.rb', line 9 def name @name end |
#people ⇒ Array (readonly)
Returns List of Person which includes all members stated under “Vorstand und Geschäftsführung” and “Verbandsvertreter/-innen”.
21 22 23 |
# File 'lib/lobbyliste/organisation.rb', line 21 def people @people end |
#tags ⇒ Array (readonly)
Returns list of tags.
33 34 35 |
# File 'lib/lobbyliste/organisation.rb', line 33 def end |
Instance Method Details
#addresses ⇒ Array
Returns list of all known addresses.
53 54 55 |
# File 'lib/lobbyliste/organisation.rb', line 53 def addresses [address,additional_address,address_at_bt_br].reject(&:nil?) end |
#to_json(*a) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/lobbyliste/organisation.rb', line 57 def to_json(*a) { id: id, name: name, addresses: addresses, people: people, interests: interests, members: members, associated_organisations: associated_organisations, tags: , abbreviations: abbreviations }.to_json(*a) end |