Sha256: 9ae2f8595726828ab7023c129756cbeadc4da38cb0d395727c1aa3d54c2bb26a

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents



module Rudy::AWS

  
  class SimpleDB
    class Domains 
      include Rudy::AWS::ObjectBase
      
      def create(name)
        @aws.create_domain(name)
      end
      
      def destroy(name)
        @aws.delete_domain(name)
      end
    
      def list
        @aws.list_domains
      end
    end
    
    def destroy(domain, item, attributes={})
      @aws.delete_attributes(domain, item, attributes)
    end
    
    def store(domain, item, attributes={}, replace=false)
      @aws.put_attributes(domain, item, attributes, replace)
    end
    
    def query(domain, query=nil, max=nil)
      @aws.query(domain, query, max)
    end
    
    def query_with_attributes(domain, query, max=nil)
      items = {}
      query(domain, query)[:items].each do |item|
        items[item] = get_attributes(domain, item)[:attributes]
      end
      items
    end
    
    def select(query)
      list = @aws2.select(query) || []
      list[0]
    end
    
    def get_attributes(domain, item, attribute=nil)
      @aws.get_attributes(domain, item, attribute)
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
solutious-rudy-0.4.0 lib/rudy/aws/simpledb.rb
rudy-0.4.0 lib/rudy/aws/simpledb.rb
rudy-0.3.0 lib/rudy/aws/simpledb.rb
rudy-0.3.2 lib/rudy/aws/simpledb.rb