Class: Wduck::DuckHelper::SearchResult
- Inherits:
-
Object
- Object
- Wduck::DuckHelper::SearchResult
- Defined in:
- lib/wduck/duck_helper.rb
Instance Attribute Summary collapse
-
#abstract ⇒ Object
readonly
Returns the value of attribute abstract.
-
#answer ⇒ Object
readonly
Returns the value of attribute answer.
-
#heading ⇒ Object
readonly
Returns the value of attribute heading.
-
#related_topics ⇒ Object
readonly
Returns the value of attribute related_topics.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(query) ⇒ SearchResult
constructor
A new instance of SearchResult.
Constructor Details
#initialize(query) ⇒ SearchResult
Returns a new instance of SearchResult.
15 16 17 18 19 20 21 22 |
# File 'lib/wduck/duck_helper.rb', line 15 def initialize(query) @parsed_data = get_json_data query @heading = check_data "Heading" @source = check_data "AbstractSource" @answer = check_data "Answer" @abstract = check_data "AbstractText" @related_topics = check_data "RelatedTopics" end |
Instance Attribute Details
#abstract ⇒ Object (readonly)
Returns the value of attribute abstract.
13 14 15 |
# File 'lib/wduck/duck_helper.rb', line 13 def abstract @abstract end |
#answer ⇒ Object (readonly)
Returns the value of attribute answer.
13 14 15 |
# File 'lib/wduck/duck_helper.rb', line 13 def answer @answer end |
#heading ⇒ Object (readonly)
Returns the value of attribute heading.
13 14 15 |
# File 'lib/wduck/duck_helper.rb', line 13 def heading @heading end |
#related_topics ⇒ Object (readonly)
Returns the value of attribute related_topics.
13 14 15 |
# File 'lib/wduck/duck_helper.rb', line 13 def @related_topics end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
13 14 15 |
# File 'lib/wduck/duck_helper.rb', line 13 def source @source end |