Class: PublishMyData::SparqlQueryResult
- Inherits:
-
Object
- Object
- PublishMyData::SparqlQueryResult
- Defined in:
- lib/publish_my_data/sparql_query_result.rb
Overview
class to wrap up a string sparql result
Instance Attribute Summary collapse
-
#result_str ⇒ Object
readonly
Returns the value of attribute result_str.
Instance Method Summary collapse
-
#initialize(result_str) ⇒ SparqlQueryResult
constructor
A new instance of SparqlQueryResult.
-
#length ⇒ Object
responds to a bunch of to_x methods to help with rails responders /rendering.
- #to_json(opts = {}) ⇒ Object
- #to_s ⇒ Object
- #to_xml(opts = {}) ⇒ Object
Constructor Details
#initialize(result_str) ⇒ SparqlQueryResult
Returns a new instance of SparqlQueryResult.
8 9 10 |
# File 'lib/publish_my_data/sparql_query_result.rb', line 8 def initialize(result_str) @result_str = result_str end |
Instance Attribute Details
#result_str ⇒ Object (readonly)
Returns the value of attribute result_str.
6 7 8 |
# File 'lib/publish_my_data/sparql_query_result.rb', line 6 def result_str @result_str end |
Instance Method Details
#length ⇒ Object
responds to a bunch of to_x methods to help with rails responders /rendering.
13 14 15 |
# File 'lib/publish_my_data/sparql_query_result.rb', line 13 def length self.to_s.length end |
#to_json(opts = {}) ⇒ Object
27 28 29 |
# File 'lib/publish_my_data/sparql_query_result.rb', line 27 def to_json(opts={}) to_s end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/publish_my_data/sparql_query_result.rb', line 17 def to_s self.result_str end |
#to_xml(opts = {}) ⇒ Object
31 32 33 |
# File 'lib/publish_my_data/sparql_query_result.rb', line 31 def to_xml(opts={}) to_s end |