Class: PaloAlto::Union

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/palo_alto/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*expressions) ⇒ Union

Returns a new instance of Union.



165
166
167
# File 'lib/palo_alto/config.rb', line 165

def initialize(*expressions)
@expressions = expressions
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object

rubocop:disable Style/MissingRespondToMissing



174
175
176
# File 'lib/palo_alto/config.rb', line 174

def method_missing(*args) # rubocop:disable Style/MissingRespondToMissing
PaloAlto::Union.new(*arguments.map { |e| e.send(*args) })
end

Instance Attribute Details

#expressionsObject (readonly) Also known as: arguments

Returns the value of attribute expressions.



163
164
165
# File 'lib/palo_alto/config.rb', line 163

def expressions
  @expressions
end

Instance Method Details

#each(&block) ⇒ Object



171
172
173
# File 'lib/palo_alto/config.rb', line 171

def each(&block)
arguments.each(&block)
end

#expressionObject



168
169
170
# File 'lib/palo_alto/config.rb', line 168

def expression
:union
end

#to_xpath(type = nil) ⇒ Object



177
178
179
# File 'lib/palo_alto/config.rb', line 177

def to_xpath(type = nil)
Renderer.render(self, type)
end