Class: InternetMessage::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/internet_message/tokenizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value) ⇒ Token

Returns a new instance of Token.



50
51
52
# File 'lib/internet_message/tokenizer.rb', line 50

def initialize(type, value)
  @type, @value = type, value
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



48
49
50
# File 'lib/internet_message/tokenizer.rb', line 48

def type
  @type
end

#valueObject (readonly) Also known as: to_s

Returns the value of attribute value.



48
49
50
# File 'lib/internet_message/tokenizer.rb', line 48

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



56
57
58
# File 'lib/internet_message/tokenizer.rb', line 56

def ==(other)
  other.is_a?(self.class) && other.type == self.type && other.value == self.value
end