lib/twitter_cldr/tokenizers/token.rb in twitter_cldr-3.0.4 vs lib/twitter_cldr/tokenizers/token.rb in twitter_cldr-3.0.5

- old
+ new

@@ -12,15 +12,20 @@ options.each_pair do |key, val| self.send("#{key.to_s}=", val) end end + def to_hash + { :value => @value, :type => @type } + end + def to_s @value end - def to_hash - { :value => @value, :type => @type } + # overriding `to_s` also overrides `inspect`, so we have to redefine it manually + def inspect + "<#{self.class}: #{instance_variables.map {|v| "#{v}=#{instance_variable_get(v).inspect}" }.join(", ")}>" end end end end \ No newline at end of file