Class: Ruby::Rego::AST::Literal

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby/rego/ast/literal.rb

Overview

Base class for literal values.

Instance Attribute Summary collapse

Attributes inherited from Base

#location

Instance Method Summary collapse

Methods inherited from Base

#==, #accept, #deconstruct_keys, #eql?, format_value, #hash, #to_s

Constructor Details

#initialize(value:, location: nil) ⇒ Literal

Returns a new instance of Literal.

Parameters:

  • value (Object)
  • location (Location, nil) (defaults to: nil)


12
13
14
15
# File 'lib/ruby/rego/ast/literal.rb', line 12

def initialize(value:, location: nil)
  super(location: location)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns:

  • (Object)


18
19
20
# File 'lib/ruby/rego/ast/literal.rb', line 18

def value
  @value
end