Class: Lobbyliste::List

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

Overview

This class represents an instance of the parsed lobbylist.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(organisations, tags, abbreviations, last_update) ⇒ List

Returns a new instance of List.



18
19
20
21
22
23
# File 'lib/lobbyliste/list.rb', line 18

def initialize(organisations, tags, abbreviations, last_update)
  @organisations = organisations
  @tags=tags
  @abbreviations = abbreviations
  @last_update = last_update
end

Instance Attribute Details

#abbreviationsHash (readonly)

Returns keys are the abbreviations, values are Arrays of organisation ids.

Returns:

  • (Hash)

    keys are the abbreviations, values are Arrays of organisation ids



13
14
15
# File 'lib/lobbyliste/list.rb', line 13

def abbreviations
  @abbreviations
end

#last_updateDate (readonly)

Returns the date when the document was last updated.

Returns:

  • (Date)

    the date when the document was last updated



16
17
18
# File 'lib/lobbyliste/list.rb', line 16

def last_update
  @last_update
end

#organisationsArray (readonly)

Returns list of organisations.

Returns:

  • (Array)

    list of organisations



7
8
9
# File 'lib/lobbyliste/list.rb', line 7

def organisations
  @organisations
end

#tagsHash (readonly)

Returns keys are the tags, values are Arrays of organisation ids.

Returns:

  • (Hash)

    keys are the tags, values are Arrays of organisation ids



10
11
12
# File 'lib/lobbyliste/list.rb', line 10

def tags
  @tags
end

Instance Method Details

#to_json(*a) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/lobbyliste/list.rb', line 25

def to_json(*a)
  {
      organisations: organisations,
      tags: tags,
      abbreviations: abbreviations,
      last_update: last_update
  }.to_json(*a)
end