Module: RAWS::SDB::Model::ClassMethods

Extended by:
Forwardable
Defined in:
lib/raws/sdb/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#domain_nameObject

Returns the value of attribute domain_name.



32
33
34
# File 'lib/raws/sdb/model.rb', line 32

def domain_name
  @domain_name
end

Instance Method Details

#create_idObject



49
50
51
52
53
# File 'lib/raws/sdb/model.rb', line 49

def create_id
  [
    UUIDTools::UUID.random_create.raw
  ].pack('m').sub(/==\n$/, '').tr('+/', '-_')
end

#domainObject



34
35
36
# File 'lib/raws/sdb/model.rb', line 34

def domain
  RAWS::SDB[domain_name]
end

#find(id) ⇒ Object



43
44
45
46
47
# File 'lib/raws/sdb/model.rb', line 43

def find(id)
  if attrs = get_attributes(id)
    self.new(attrs, id, true)
  end
end

#select(&block) ⇒ Object Also known as: all



38
39
40
# File 'lib/raws/sdb/model.rb', line 38

def select(&block)
  Select.new(self).from(domain_name, &block)
end