Class: Bipm::Data::Outcomes::LocalizedBody
- Includes:
- Enumerable
- Defined in:
- lib/bipm/data/outcomes/localized_body.rb
Instance Attribute Summary collapse
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
Attributes inherited from Body
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #file_path ⇒ Object
-
#initialize(body, locale) ⇒ LocalizedBody
constructor
A new instance of LocalizedBody.
- #meeting(name) ⇒ Object (also: #[])
- #meetings ⇒ Object
Methods inherited from Body
Constructor Details
#initialize(body, locale) ⇒ LocalizedBody
Returns a new instance of LocalizedBody.
5 6 7 8 |
# File 'lib/bipm/data/outcomes/localized_body.rb', line 5 def initialize(body, locale) super @locale = locale end |
Instance Attribute Details
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
10 11 12 |
# File 'lib/bipm/data/outcomes/localized_body.rb', line 10 def locale @locale end |
Instance Method Details
#each(&block) ⇒ Object
30 31 32 |
# File 'lib/bipm/data/outcomes/localized_body.rb', line 30 def each(&block) meetings.values.each(&block) end |
#file_path ⇒ Object
12 13 14 |
# File 'lib/bipm/data/outcomes/localized_body.rb', line 12 def file_path "#{super}meetings-#{@locale}/" end |
#meeting(name) ⇒ Object Also known as: []
17 18 19 |
# File 'lib/bipm/data/outcomes/localized_body.rb', line 17 def meeting(name) Meeting.new(self, name) end |
#meetings ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/bipm/data/outcomes/localized_body.rb', line 22 def meetings Dir["#{file_path}*"].to_h do |name| name = name.split("/").last.split("-", 2).last.split(".").first [name, meeting(name)] end end |