Class: RPath::Attribute

Inherits:
Expression show all
Defined in:
lib/rpath/expressions.rb

Overview

Given a prior expression producing a vertex V, evaluates to the value of the attribute of V with the given name.

Instance Method Summary collapse

Methods inherited from Expression

#eval

Constructor Details

#initialize(prior, name) ⇒ Attribute

Returns a new instance of Attribute.

Parameters:

  • prior (Expression)

    An expression that evaluates to a vertex

  • name (String)

    The name of the attribute



291
292
293
294
295
# File 'lib/rpath/expressions.rb', line 291

def initialize(prior, name)
  super()
  @prior = prior
  @name = name
end

Instance Method Details

#to_sString

Returns:

  • (String)


298
299
300
# File 'lib/rpath/expressions.rb', line 298

def to_s
  "#{@prior}[#{@name}]"
end