Class: Amanzi::SLD::FilterBuilder

Inherits:
ElementWrapper show all
Defined in:
lib/amanzi/sld.rb

Direct Known Subclasses

BooleanFilterBuilder

Instance Attribute Summary

Attributes inherited from ElementWrapper

#element

Instance Method Summary collapse

Methods inherited from ElementWrapper

#method_missing

Methods included from Logger

#puts

Constructor Details

#initialize(filter) ⇒ FilterBuilder

Returns a new instance of FilterBuilder.



179
180
181
182
# File 'lib/amanzi/sld.rb', line 179

def initialize(filter)
  super filter
  puts "Created filter builder: #{element}"
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Amanzi::SLD::ElementWrapper

Instance Method Details

#geometry=(type) ⇒ Object



183
184
185
186
187
188
# File 'lib/amanzi/sld.rb', line 183

def geometry=(type)
  element.property_is_equal_to do |f|
    f.function(:name => 'geometryType').property_name << (Config.config[:geometry_property] || 'geom')
    f.literal << type
  end
end

#op(op_type) {|@op[op_type] ||= BooleanFilterBuilder.new(element,op_type)| ... } ⇒ Object

Yields:



192
193
194
195
196
197
# File 'lib/amanzi/sld.rb', line 192

def op(op_type)
  op_type = op_type.to_s.intern
  @op ||= {}
  yield(@op[op_type] ||= BooleanFilterBuilder.new(element,op_type)) if(block_given?)
  @op[op_type]
end

#propertyObject



189
190
191
# File 'lib/amanzi/sld.rb', line 189

def property
  @property ||= PropertyFilterBuilder.new(element)
end