Class: Gitlab::TemplateParser::AST::Integer

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab/template_parser/ast.rb

Overview

An integer used in a selector.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value


52
53
54
# File 'lib/gitlab/template_parser/ast.rb', line 52

def value
  @value
end

Instance Method Details

#evaluate(state, data) ⇒ Object


53
54
55
# File 'lib/gitlab/template_parser/ast.rb', line 53

def evaluate(state, data)
  data[value] if data.is_a?(Array)
end