Class: Result
- Inherits:
-
Object
- Object
- Result
- Defined in:
- lib/cite_mapper.rb
Instance Attribute Summary collapse
-
#section ⇒ Object
readonly
Returns the value of attribute section.
Instance Method Summary collapse
- #author ⇒ Object
-
#initialize(author, work, section) ⇒ Result
constructor
A new instance of Result.
- #to_json ⇒ Object
- #work ⇒ Object
Constructor Details
#initialize(author, work, section) ⇒ Result
Returns a new instance of Result.
102 103 104 105 106 |
# File 'lib/cite_mapper.rb', line 102 def initialize(, work, section) @author_obj = @work_obj = work @section = section end |
Instance Attribute Details
#section ⇒ Object (readonly)
Returns the value of attribute section.
100 101 102 |
# File 'lib/cite_mapper.rb', line 100 def section @section end |
Instance Method Details
#author ⇒ Object
108 109 110 |
# File 'lib/cite_mapper.rb', line 108 def @author_obj.name end |
#to_json ⇒ Object
116 117 118 119 |
# File 'lib/cite_mapper.rb', line 116 def to_json content = %i{ author work section }.map { |category| to_property(category) } %{{ #{content.join(', ')} }} end |
#work ⇒ Object
112 113 114 |
# File 'lib/cite_mapper.rb', line 112 def work @work_obj.name end |