Sha256: 69e3f0fb63e1da0e36c99528c79cc078b4d7e8713d819e6eded9438275d1a379

Contents?: true

Size: 601 Bytes

Versions: 58

Compression:

Stored size: 601 Bytes

Contents

module PublishMyData

  # class to wrap up a string sparql result
  class SparqlQueryResult

    attr_reader :result_str

    def initialize(result_str)
      @result_str = result_str
    end

    # responds to a bunch of to_x methods to help with rails responders /rendering.
    def length
      self.to_s.length
    end

    def to_s
      self.result_str
    end

    [:csv, :nt, :ttl, :rdf, :text].each do |format|
      define_method :"to_#{format.to_s}" do
        self.to_s
      end
    end

    def to_json(opts={})
      to_s
    end

    def to_xml(opts={})
      to_s
    end

  end

end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
publish_my_data-1.3.25 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.24 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.23 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.22 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.21 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.20 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.19 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.18 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.17 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.16 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.15 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.14 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.13 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.12 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.11 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.10 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.9 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.8 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.7 lib/publish_my_data/sparql_query_result.rb
publish_my_data-1.3.6 lib/publish_my_data/sparql_query_result.rb