Class: TwitterCldr::Tokenizers::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/tokenizers/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Token

Returns a new instance of Token.


11
12
13
14
15
# 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

Instance Attribute Details

#typeObject

Returns the value of attribute type


9
10
11
# File 'lib/twitter_cldr/tokenizers/token.rb', line 9

def type
  @type
end

#valueObject

Returns the value of attribute value


9
10
11
# File 'lib/twitter_cldr/tokenizers/token.rb', line 9

def value
  @value
end

Instance Method Details

#to_hashObject


21
22
23
# File 'lib/twitter_cldr/tokenizers/token.rb', line 21

def to_hash
  { :value => @value, :type => @type }
end

#to_sObject


17
18
19
# File 'lib/twitter_cldr/tokenizers/token.rb', line 17

def to_s
  @value
end