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