Sha256: 1aba7ad818c5d4ae2a4f4892ddcf15c7d12a3a224881f282dd854287f84e6c76
Contents?: true
Size: 1.24 KB
Versions: 3
Compression:
Stored size: 1.24 KB
Contents
require 'fog' module Stackster class AWS class SimpleDB def initialize(args) c = args[:config] @connect = Fog::AWS::SimpleDB.new :aws_access_key_id => c.access_key, :aws_secret_access_key => c.secret_key, :region => c.region end def domains @connect.list_domains.body['Domains'] end def domain_exists?(domain) domains.include? domain end def create_domain(domain) @connect.create_domain(domain) unless domain_exists?(domain) end def put_attributes(domain, key, attributes, options) @connect.put_attributes domain, key, attributes, options end def select(query) options = { 'ConsistentRead' => true } data = {} next_token = nil while true options.merge! 'NextToken' => next_token chunk = @connect.select(query, options).body data.merge! chunk['Items'] next_token = chunk['NextToken'] break unless next_token end data end def delete(domain, key) @connect.delete_attributes domain, key end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
stackster-0.4.4 | lib/stackster/aws/simpledb.rb |
stackster-0.4.3 | lib/stackster/aws/simpledb.rb |
stackster-0.4.2 | lib/stackster/aws/simpledb.rb |