Class: Pinpoint::Format::Token

Inherits:
Struct
  • Object
show all
Defined in:
lib/pinpoint/format/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Token

Returns a new instance of Token.



6
7
8
9
10
# File 'lib/pinpoint/format/token.rb', line 6

def initialize(*args)
  args[0] = args[0].to_sym

  super
end

Instance Attribute Details

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



5
6
7
# File 'lib/pinpoint/format/token.rb', line 5

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



5
6
7
# File 'lib/pinpoint/format/token.rb', line 5

def value
  @value
end

Instance Method Details

#processed_valueObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pinpoint/format/token.rb', line 12

def processed_value
  case type
  when :group_start
    :group_start
  when :group_end
    :group_end
  when :literal
    value
  else
    message
  end
end

#to_aryObject



25
26
27
# File 'lib/pinpoint/format/token.rb', line 25

def to_ary
  [type, value]
end