Class: Lobbyliste::Organisation

Inherits:
Object
  • Object
show all
Defined in:
lib/lobbyliste/organisation.rb

Overview

Class to encapsulate an organisation

Instance Attribute Summary collapse

Instance Method Summary collapse

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,tags,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
  @tags = tags
  @abbreviations = abbreviations
end

Instance Attribute Details

#abbreviationsArray (readonly)

Returns list of abbreviations.

Returns:

  • (Array)

    list of abbreviations



36
37
38
# File 'lib/lobbyliste/organisation.rb', line 36

def abbreviations
  @abbreviations
end

#additional_addressLobbyliste::Address (readonly)

Returns the address stated under “Weitere Addresse”.

Returns:



15
16
17
# File 'lib/lobbyliste/organisation.rb', line 15

def additional_address
  @additional_address
end

#addressLobbyliste::Address (readonly)

Returns the primary Address of the organisation.

Returns:



12
13
14
# File 'lib/lobbyliste/organisation.rb', line 12

def address
  @address
end

#address_at_bt_brLobbyliste::Address (readonly)

Returns the address stated under “Anschrift am Sitz von BT und BRg”.

Returns:



18
19
20
# File 'lib/lobbyliste/organisation.rb', line 18

def address_at_bt_br
  @address_at_bt_br
end

#associated_organisationsInteger (readonly)

Returns number of associated organisations as stated under “Anzahl der angeschlossenen Organisationen”.

Returns:

  • (Integer)

    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

#idInteger (readonly)

Returns the organisation id of the organisation. This number is not fix and may change with every new document version.

Returns:

  • (Integer)

    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

#interestsString (readonly)

Returns interests as stated under “Interessenbereich”.

Returns:

  • (String)

    interests as stated under “Interessenbereich”



24
25
26
# File 'lib/lobbyliste/organisation.rb', line 24

def interests
  @interests
end

#membersInteger (readonly)

Returns number of members as stated under “Mitgleiderzahl”.

Returns:

  • (Integer)

    number of members as stated under “Mitgleiderzahl”



27
28
29
# File 'lib/lobbyliste/organisation.rb', line 27

def members
  @members
end

#nameString (readonly)

Returns the organisations name.

Returns:

  • (String)

    the organisations name



9
10
11
# File 'lib/lobbyliste/organisation.rb', line 9

def name
  @name
end

#peopleArray (readonly)

Returns List of Person which includes all members stated under “Vorstand und Geschäftsführung” and “Verbandsvertreter/-innen”.

Returns:

  • (Array)

    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

#tagsArray (readonly)

Returns list of tags.

Returns:

  • (Array)

    list of tags



33
34
35
# File 'lib/lobbyliste/organisation.rb', line 33

def tags
  @tags
end

Instance Method Details

#addressesArray

Returns list of all known addresses.

Returns:

  • (Array)

    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: tags,
      abbreviations: abbreviations
  }.to_json(*a)
end