Class: Kokkai::Record
- Inherits:
-
Object
- Object
- Kokkai::Record
- Defined in:
- lib/kokkai/record.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_ATTRIBUTES =
%i(session number_of_house name_of_meeting issue date meeting_url pdf_url).freeze
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#raw_record ⇒ Object
readonly
Returns the value of attribute raw_record.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw) ⇒ Record
constructor
A new instance of Record.
Constructor Details
#initialize(raw) ⇒ Record
Returns a new instance of Record.
23 24 25 26 |
# File 'lib/kokkai/record.rb', line 23 def initialize(raw) @raw = raw @raw_record = @raw.dig("recordData") end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/kokkai/record.rb', line 7 def raw @raw end |
#raw_record ⇒ Object (readonly)
Returns the value of attribute raw_record.
7 8 9 |
# File 'lib/kokkai/record.rb', line 7 def raw_record @raw_record end |
Class Method Details
.define_attribute_methods(attrs) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/kokkai/record.rb', line 12 def define_attribute_methods(attrs) attrs.each do |attr| define_method(attr) do @raw_record ? @raw_record[attr.to_s.to_camel] : nil end end end |