Class: TDriver::AttributeFilter
- Defined in:
- lib/tdriver/util/filters/attribute_filter.rb
Class Method Summary collapse
-
.add_attribute(attribute) ⇒ Object
TODO: document me.
-
.add_attributes(attributes) ⇒ Object
TODO: document me.
-
.filter_string ⇒ Object
TODO: document me.
-
.has_attribute?(attribute) ⇒ Boolean
TODO: document me.
-
.reset ⇒ Object
TODO: document me.
Class Method Details
.add_attribute(attribute) ⇒ Object
TODO: document me
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/tdriver/util/filters/attribute_filter.rb', line 25 def self.add_attribute( attribute ) _attribute = attribute.to_s unless @attributes.include?( _attribute ) @attributes << _attribute.to_s @attributes_string = @attributes.join( ',' ) yield if block_given? end end |
.add_attributes(attributes) ⇒ Object
TODO: document me
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/tdriver/util/filters/attribute_filter.rb', line 42 def self.add_attributes( attributes ) updated_list = @attributes | attributes.collect{ | value | value.to_s } unless updated_list == @attributes @attributes = updated_list @attributes_string = @attributes.join( ',' ) yield if block_given? end end |
.filter_string ⇒ Object
TODO: document me
66 67 68 69 70 |
# File 'lib/tdriver/util/filters/attribute_filter.rb', line 66 def self.filter_string @attributes_string end |
.has_attribute?(attribute) ⇒ Boolean
TODO: document me
59 60 61 62 63 |
# File 'lib/tdriver/util/filters/attribute_filter.rb', line 59 def self.has_attribute?( attribute ) @attributes.include?( attribute.to_s ) end |
.reset ⇒ Object
TODO: document me
73 74 75 76 77 78 79 |
# File 'lib/tdriver/util/filters/attribute_filter.rb', line 73 def self.reset @attributes_string = "" @attributes = [] end |