Class: Fop::Nodes::Expression

Inherits:
Struct
  • Object
show all
Defined in:
lib/fop/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argObject

Returns the value of attribute arg

Returns:

  • (Object)

    the current value of arg



17
18
19
# File 'lib/fop/nodes.rb', line 17

def arg
  @arg
end

#matchObject

Returns the value of attribute match

Returns:

  • (Object)

    the current value of match



17
18
19
# File 'lib/fop/nodes.rb', line 17

def match
  @match
end

#operatorObject

Returns the value of attribute operator

Returns:

  • (Object)

    the current value of operator



17
18
19
# File 'lib/fop/nodes.rb', line 17

def operator
  @operator
end

#regexObject

Returns the value of attribute regex

Returns:

  • (Object)

    the current value of regex



17
18
19
# File 'lib/fop/nodes.rb', line 17

def regex
  @regex
end

#regex_matchObject

Returns the value of attribute regex_match

Returns:

  • (Object)

    the current value of regex_match



17
18
19
# File 'lib/fop/nodes.rb', line 17

def regex_match
  @regex_match
end

#wildcardObject

Returns the value of attribute wildcard

Returns:

  • (Object)

    the current value of wildcard



17
18
19
# File 'lib/fop/nodes.rb', line 17

def wildcard
  @wildcard
end

Instance Method Details

#to_sObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fop/nodes.rb', line 18

def to_s
  w = wildcard ? "*" : nil
  s = "[#{w}exp] #{match}"
  if operator
    arg_str = arg
      .map { |a| a.is_a?(Integer) ? "$#{a+1}" : a.to_s }
      .join("")
    s << " #{operator} #{arg_str}"
  end
  s
end