Class: Glaemscribe::API::Eval::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/api/eval.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, expression) ⇒ Token

Returns a new instance of Token.



39
40
41
42
43
# File 'lib/api/eval.rb', line 39

def initialize(name, expression)
  @name        = name
  @expression  = expression
  @value       = nil
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



37
38
39
# File 'lib/api/eval.rb', line 37

def expression
  @expression
end

#nameObject (readonly)

Returns the value of attribute name.



37
38
39
# File 'lib/api/eval.rb', line 37

def name
  @name
end

#valueObject

Returns the value of attribute value.



38
39
40
# File 'lib/api/eval.rb', line 38

def value
  @value
end

Instance Method Details

#clone(value = nil) ⇒ Object



47
48
49
50
51
# File 'lib/api/eval.rb', line 47

def clone(value=nil)
  t = super()
  t.value = value
  t
end

#regexp?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/api/eval.rb', line 44

def regexp?
  @expression.is_a? Regexp
end