Class: JMAFeed::ResultEntry
- Inherits:
-
Struct
- Object
- Struct
- JMAFeed::ResultEntry
- Defined in:
- lib/jma_feed/result_entry.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#content ⇒ Object
Returns the value of attribute content.
-
#id ⇒ Object
Returns the value of attribute id.
-
#link ⇒ Object
Returns the value of attribute link.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated ⇒ Object
Returns the value of attribute updated.
Instance Method Summary collapse
- #identifier ⇒ Object
- #identifier_components ⇒ Object
- #report ⇒ Object
- #report_area_code ⇒ Object
- #report_code ⇒ Object
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author
1 2 3 |
# File 'lib/jma_feed/result_entry.rb', line 1 def @author end |
#content ⇒ Object
Returns the value of attribute content
1 2 3 |
# File 'lib/jma_feed/result_entry.rb', line 1 def content @content end |
#id ⇒ Object
Returns the value of attribute id
1 2 3 |
# File 'lib/jma_feed/result_entry.rb', line 1 def id @id end |
#link ⇒ Object
Returns the value of attribute link
1 2 3 |
# File 'lib/jma_feed/result_entry.rb', line 1 def link @link end |
#title ⇒ Object
Returns the value of attribute title
1 2 3 |
# File 'lib/jma_feed/result_entry.rb', line 1 def title @title end |
#updated ⇒ Object
Returns the value of attribute updated
1 2 3 |
# File 'lib/jma_feed/result_entry.rb', line 1 def updated @updated end |
Instance Method Details
#identifier ⇒ Object
4 5 6 |
# File 'lib/jma_feed/result_entry.rb', line 4 def identifier @identifier ||= id.split('/').last.sub(/\.\w+\z/, '') end |
#identifier_components ⇒ Object
8 9 10 |
# File 'lib/jma_feed/result_entry.rb', line 8 def identifier_components time, number, report_code, report_area_code = identifier.split('_') end |
#report ⇒ Object
16 17 18 19 |
# File 'lib/jma_feed/result_entry.rb', line 16 def report return nil if report_code.nil? @report ||= JMAFeed::Report.latest.detect{_1.has_code?(report_code)} end |
#report_area_code ⇒ Object
21 22 23 |
# File 'lib/jma_feed/result_entry.rb', line 21 def report_area_code @report_area_code ||= identifier_components[3] end |
#report_code ⇒ Object
12 13 14 |
# File 'lib/jma_feed/result_entry.rb', line 12 def report_code @report_code ||= identifier_components[2] end |