Class: SdbDal::EqualsCondition
- Inherits:
-
Object
- Object
- SdbDal::EqualsCondition
- Defined in:
- lib/sdb_dal/equals_condition.rb
Instance Attribute Summary collapse
-
#attribute_description ⇒ Object
Returns the value of attribute attribute_description.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(attribute_description, value) ⇒ EqualsCondition
constructor
A new instance of EqualsCondition.
- #matches?(domain_object) ⇒ Boolean
- #to_sdb_query ⇒ Object
Constructor Details
#initialize(attribute_description, value) ⇒ EqualsCondition
Returns a new instance of EqualsCondition.
7 8 9 10 |
# File 'lib/sdb_dal/equals_condition.rb', line 7 def initialize(attribute_description,value) self.attribute_description=attribute_description self.value=value end |
Instance Attribute Details
#attribute_description ⇒ Object
Returns the value of attribute attribute_description.
5 6 7 |
# File 'lib/sdb_dal/equals_condition.rb', line 5 def attribute_description @attribute_description end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/sdb_dal/equals_condition.rb', line 6 def value @value end |
Instance Method Details
#matches?(domain_object) ⇒ Boolean
11 12 13 |
# File 'lib/sdb_dal/equals_condition.rb', line 11 def matches?(domain_object) return domain_object[attribute_description.name]==value end |
#to_sdb_query ⇒ Object
14 15 16 |
# File 'lib/sdb_dal/equals_condition.rb', line 14 def to_sdb_query return "'#{self.attribute_description.name}'='#{self.attribute_description.format_for_sdb(self.value)}'" end |