Sha256: 2d3612037533a2afe22070ff7fa722689eb4f5f2ee165e884020b7cce524abe7
Contents?: true
Size: 595 Bytes
Versions: 12
Compression:
Stored size: 595 Bytes
Contents
module Dentaku class Token attr_reader :category, :raw_value, :value def initialize(category, value, raw_value=nil) @category = category @value = value @raw_value = raw_value end def to_s raw_value || value end def length raw_value.to_s.length end def grouping? is?(:grouping) end def is?(c) category == c end def ==(other) (category.nil? || other.category.nil? || category == other.category) && (value.nil? || other.value.nil? || value == other.value) end end end
Version data entries
12 entries across 12 versions & 1 rubygems