class TwitterCldr::Tokenizers::Token

Attributes

type[RW]
value[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/twitter_cldr/tokenizers/token.rb, line 11
def initialize(options = {})
  options.each_pair do |key, val|
    self.send("#{key.to_s}=", val)
  end
end

Public Instance Methods

inspect() click to toggle source

overriding `to_s` also overrides `inspect`, so we have to redefine it manually

# File lib/twitter_cldr/tokenizers/token.rb, line 26
def inspect
  "<#{self.class}: #{instance_variables.map {|v| "#{v}=#{instance_variable_get(v).inspect}" }.join(", ")}>"
end
to_hash() click to toggle source
# File lib/twitter_cldr/tokenizers/token.rb, line 17
def to_hash
  { value: @value, type: @type }
end
to_s() click to toggle source
# File lib/twitter_cldr/tokenizers/token.rb, line 21
def to_s
  @value
end