Class: Bipm::Data::Outcomes::Approval

Inherits:
Object
  • Object
show all
Defined in:
lib/bipm/data/outcomes/approval.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resolution, index) ⇒ Approval

Returns a new instance of Approval.

Raises:

  • (IndexError)


5
6
7
8
9
10
# File 'lib/bipm/data/outcomes/approval.rb', line 5

def initialize(resolution, index)
  @resolution = resolution
  @index = index

  raise IndexError unless document
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



16
17
18
# File 'lib/bipm/data/outcomes/approval.rb', line 16

def index
  @index
end

#resolutionObject (readonly)

Returns the value of attribute resolution.



16
17
18
# File 'lib/bipm/data/outcomes/approval.rb', line 16

def resolution
  @resolution
end

Instance Method Details

#documentObject



12
13
14
# File 'lib/bipm/data/outcomes/approval.rb', line 12

def document
  @resolution.document.dig("approvals", index)
end

#messageObject



19
20
21
# File 'lib/bipm/data/outcomes/approval.rb', line 19

def message
  document["message"]
end