Class: Ruckus::Filter
Constant Summary
Constants inherited from Parsel
Instance Attribute Summary
Attributes inherited from Parsel
#name, #parent, #rendered_offset, #rendering, #tag, #value
Instance Method Summary collapse
-
#initialize(val, &block) ⇒ Filter
constructor
A new instance of Filter.
- #to_s ⇒ Object
Methods inherited from Parsel
bytes_for_bits, coerce, #each_matching_selector, endian?, factory?, #find_containing, #find_tag, #find_tag_struct, #fixup, #in, #incomplete!, #index_for_selectors, #inspect, #matches_selector?, #method_missing, #native?, native?, #next, #out, #parent_structure, #permute, #prev, #resolve, #respond_to?, #root, #size, #visit, #where_am_i?
Constructor Details
#initialize(val, &block) ⇒ Filter
Returns a new instance of Filter.
3 4 5 6 7 8 9 10 |
# File 'lib/ruckus/filter.rb', line 3 def initialize(val, &block) raise "need a block" if not block_given? val = val.clone val.parent = self opts = { :value => val } @block = block super(opts) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ruckus::Parsel
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/ruckus/filter.rb', line 12 def to_s @block.call(@value.to_s) end |