Sha256: 0a0c76c1d873540d0fd066ef85e69ae4dd2bfa3f5b6752637273afa8c2b4c246

Contents?: true

Size: 604 Bytes

Versions: 11

Compression:

Stored size: 604 Bytes

Contents

module SdbDal
 

class StartsWithCondition
    attr_accessor :attribute_description
  attr_accessor :value
  def initialize(attribute_description,value)
    self.attribute_description=attribute_description
    self.value=value
  end
   def matches?(domain_object)
     if domain_object[attribute_description.name]==nil
       return value==nil || value==:NULL
     end
       return domain_object[attribute_description.name].index(value)==0
   end
   def to_sdb_query
     return "'#{self.attribute_description.name}' starts-with '#{self.attribute_description.format_for_sdb(self.value)}'"
   end
end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sdb_dal-0.0.12 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.11 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.2 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.6 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.3 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.1 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.4 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.8 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.7 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.5 ./lib/sdb_dal/starts_with_condition.rb
sdb_dal-0.0.9 ./lib/sdb_dal/starts_with_condition.rb