Class: Bipm::Data::Outcomes::Resolution
- Inherits:
-
Object
- Object
- Bipm::Data::Outcomes::Resolution
- Defined in:
- lib/bipm/data/outcomes/resolution.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#meeting ⇒ Object
readonly
Returns the value of attribute meeting.
Instance Method Summary collapse
- #action(name) ⇒ Object
- #actions ⇒ Object
- #approval(name) ⇒ Object
- #approvals ⇒ Object
- #consideration(name) ⇒ Object
- #considerations ⇒ Object
- #dates ⇒ Object
- #document ⇒ Object
- #id ⇒ Object
-
#initialize(meeting, index) ⇒ Resolution
constructor
A new instance of Resolution.
- #reference ⇒ Object
- #reference_name ⇒ Object
- #reference_page ⇒ Object
- #subject ⇒ Object
- #title ⇒ Object
- #type ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(meeting, index) ⇒ Resolution
Returns a new instance of Resolution.
7 8 9 10 11 12 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 7 def initialize(meeting, index) @meeting = meeting @index = index raise IndexError unless document end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
18 19 20 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 18 def index @index end |
#meeting ⇒ Object (readonly)
Returns the value of attribute meeting.
18 19 20 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 18 def meeting @meeting end |
Instance Method Details
#action(name) ⇒ Object
78 79 80 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 78 def action(name) Action.new(self, name) end |
#actions ⇒ Object
82 83 84 85 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 82 def actions return {} unless document["actions"] document["actions"].each_with_index.to_h { |_,name| [name, action(name)] } end |
#approval(name) ⇒ Object
58 59 60 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 58 def approval(name) Approval.new(self, name) end |
#approvals ⇒ Object
62 63 64 65 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 62 def approvals return {} unless document["approvals"] document["approvals"].each_with_index.to_h { |_,name| [name, approval(name)] } end |
#consideration(name) ⇒ Object
68 69 70 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 68 def consideration(name) Consideration.new(self, name) end |
#considerations ⇒ Object
72 73 74 75 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 72 def considerations return {} unless document["considerations"] document["considerations"].each_with_index.to_h { |_,name| [name, consideration(name)] } end |
#dates ⇒ Object
21 22 23 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 21 def dates document["dates"].map { |i| Date.parse(i) } end |
#document ⇒ Object
14 15 16 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 14 def document @meeting.document["resolutions"][index] end |
#id ⇒ Object
37 38 39 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 37 def id document["identifier"] end |
#reference ⇒ Object
45 46 47 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 45 def reference document["reference"] end |
#reference_name ⇒ Object
49 50 51 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 49 def reference_name document["reference_name"] end |
#reference_page ⇒ Object
53 54 55 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 53 def reference_page document["reference_page"] end |
#subject ⇒ Object
25 26 27 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 25 def subject document["subject"] end |
#title ⇒ Object
29 30 31 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 29 def title document["title"] end |
#type ⇒ Object
33 34 35 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 33 def type document["type"].to_sym end |
#url ⇒ Object
41 42 43 |
# File 'lib/bipm/data/outcomes/resolution.rb', line 41 def url document["url"] end |