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

#argsObject

Returns the value of attribute args



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

def args
  @args
end

#matchObject

Returns the value of attribute match



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

def match
  @match
end

#operator_tokenObject

Returns the value of attribute operator_token



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

def operator_token
  @operator_token
end

#regexObject

Returns the value of attribute regex



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

def regex
  @regex
end

#regex_matchObject

Returns the value of attribute 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



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_token
    arg_str = args
      .map { |a| a.is_a?(Integer) ? "$#{a+1}" : a.to_s }
      .join("")
    s << " #{operator_token.val} #{arg_str}"
  end
  s
end