Class: Ansible::Ruby::Models::JinjaExpression

Inherits:
Object
  • Object
show all
Defined in:
lib/ansible/ruby/models/jinja_expression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression) ⇒ JinjaExpression

Returns a new instance of JinjaExpression.



9
10
11
# File 'lib/ansible/ruby/models/jinja_expression.rb', line 9

def initialize(expression)
  @expression = expression
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



7
8
9
# File 'lib/ansible/ruby/models/jinja_expression.rb', line 7

def expression
  @expression
end

Instance Method Details

#===(other_node) ⇒ Object



21
22
23
# File 'lib/ansible/ruby/models/jinja_expression.rb', line 21

def ===(other_node)
  other_node.is_a?(JinjaExpression) && expression == other_node.expression
end

#to_sObject



13
14
15
# File 'lib/ansible/ruby/models/jinja_expression.rb', line 13

def to_s
  "{{ #{@expression} }}"
end

#to_strObject



17
18
19
# File 'lib/ansible/ruby/models/jinja_expression.rb', line 17

def to_str
  to_s
end