Class: Baba::Expr::Literal

Inherits:
Object
  • Object
show all
Defined in:
lib/baba/expr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Literal

Returns a new instance of Literal.



78
79
80
# File 'lib/baba/expr.rb', line 78

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



76
77
78
# File 'lib/baba/expr.rb', line 76

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



82
83
84
# File 'lib/baba/expr.rb', line 82

def accept(visitor)
  visitor.visit_literal_expr(self)
end