class NicoSearchSnapshot::Result

Public Class Methods

new(hash = nil) click to toggle source
# File lib/nico_search_snapshot/result.rb, line 9
def initialize(hash = nil)
  hash ||= {}
  hash.each { |k,v|
    send("#{k}=", v) if respond_to? "#{k}="
  }
end

Public Instance Methods

inspect() click to toggle source
# File lib/nico_search_snapshot/result.rb, line 28
def inspect
  to_hash.inspect
end
to_hash() click to toggle source
# File lib/nico_search_snapshot/result.rb, line 16
def to_hash
  Hash[*@@names.map{|v| [v, send(v)] }.flatten]
end
to_s() click to toggle source
# File lib/nico_search_snapshot/result.rb, line 24
def to_s
  to_hash.to_s
end
to_tsv() click to toggle source
# File lib/nico_search_snapshot/result.rb, line 20
def to_tsv
  to_hash.values.join("\t")
end