Class: OpenBD::Contents
- Inherits:
-
Object
- Object
- OpenBD::Contents
- Defined in:
- lib/open_bd/contents.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #contents ⇒ Object
- #contents_detail ⇒ Object
-
#initialize(source) ⇒ Contents
constructor
A new instance of Contents.
- #table_of_contents ⇒ Object
Constructor Details
#initialize(source) ⇒ Contents
Returns a new instance of Contents.
5 6 7 |
# File 'lib/open_bd/contents.rb', line 5 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
3 4 5 |
# File 'lib/open_bd/contents.rb', line 3 def source @source end |
Instance Method Details
#contents ⇒ Object
9 10 11 12 13 14 |
# File 'lib/open_bd/contents.rb', line 9 def contents value = source.find { |x| x["TextType"] == "02" } if !value.nil? value["Text"] end end |
#contents_detail ⇒ Object
16 17 18 19 20 21 |
# File 'lib/open_bd/contents.rb', line 16 def contents_detail value = source.find { |x| x["TextType"] == "03" } if !value.nil? value["Text"] end end |
#table_of_contents ⇒ Object
23 24 25 26 27 28 |
# File 'lib/open_bd/contents.rb', line 23 def table_of_contents value = source.find { |x| x["TextType"] == "04" } if !value.nil? value["Text"] end end |