Sha256: dbd3e3b6d95b811807391adc55ead15355ea4231370975fae0b52945b0cfcfcf
Contents?: true
Size: 685 Bytes
Versions: 14
Compression:
Stored size: 685 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Tokenizers class Token attr_accessor :value, :type def initialize(options = {}) 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 # 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
Version data entries
14 entries across 14 versions & 2 rubygems