dynamoid 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/Dynamoid.gemspec +65 -3
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +6 -0
  4. data/README.markdown +117 -22
  5. data/Rakefile +22 -9
  6. data/VERSION +1 -1
  7. data/doc/.nojekyll +0 -0
  8. data/doc/Dynamoid.html +300 -0
  9. data/doc/Dynamoid/Adapter.html +1387 -0
  10. data/doc/Dynamoid/Adapter/AwsSdk.html +1561 -0
  11. data/doc/Dynamoid/Adapter/Local.html +1487 -0
  12. data/doc/Dynamoid/Associations.html +131 -0
  13. data/doc/Dynamoid/Associations/Association.html +1706 -0
  14. data/doc/Dynamoid/Associations/BelongsTo.html +339 -0
  15. data/doc/Dynamoid/Associations/ClassMethods.html +723 -0
  16. data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +339 -0
  17. data/doc/Dynamoid/Associations/HasMany.html +339 -0
  18. data/doc/Dynamoid/Associations/HasOne.html +339 -0
  19. data/doc/Dynamoid/Components.html +202 -0
  20. data/doc/Dynamoid/Config.html +395 -0
  21. data/doc/Dynamoid/Config/Options.html +609 -0
  22. data/doc/Dynamoid/Criteria.html +131 -0
  23. data/doc/Dynamoid/Criteria/Chain.html +759 -0
  24. data/doc/Dynamoid/Criteria/ClassMethods.html +98 -0
  25. data/doc/Dynamoid/Document.html +512 -0
  26. data/doc/Dynamoid/Document/ClassMethods.html +581 -0
  27. data/doc/Dynamoid/Errors.html +118 -0
  28. data/doc/Dynamoid/Errors/DocumentNotValid.html +210 -0
  29. data/doc/Dynamoid/Errors/Error.html +130 -0
  30. data/doc/Dynamoid/Errors/InvalidField.html +133 -0
  31. data/doc/Dynamoid/Errors/MissingRangeKey.html +133 -0
  32. data/doc/Dynamoid/Fields.html +649 -0
  33. data/doc/Dynamoid/Fields/ClassMethods.html +264 -0
  34. data/doc/Dynamoid/Finders.html +128 -0
  35. data/doc/Dynamoid/Finders/ClassMethods.html +502 -0
  36. data/doc/Dynamoid/Indexes.html +308 -0
  37. data/doc/Dynamoid/Indexes/ClassMethods.html +351 -0
  38. data/doc/Dynamoid/Indexes/Index.html +1089 -0
  39. data/doc/Dynamoid/Persistence.html +653 -0
  40. data/doc/Dynamoid/Persistence/ClassMethods.html +568 -0
  41. data/doc/Dynamoid/Validations.html +399 -0
  42. data/doc/_index.html +439 -0
  43. data/doc/class_list.html +47 -0
  44. data/doc/css/common.css +1 -0
  45. data/doc/css/full_list.css +55 -0
  46. data/doc/css/style.css +322 -0
  47. data/doc/file.LICENSE.html +66 -0
  48. data/doc/file.README.html +279 -0
  49. data/doc/file_list.html +52 -0
  50. data/doc/frames.html +13 -0
  51. data/doc/index.html +279 -0
  52. data/doc/js/app.js +205 -0
  53. data/doc/js/full_list.js +173 -0
  54. data/doc/js/jquery.js +16 -0
  55. data/doc/method_list.html +1054 -0
  56. data/doc/top-level-namespace.html +105 -0
  57. data/lib/dynamoid.rb +2 -1
  58. data/lib/dynamoid/adapter.rb +77 -6
  59. data/lib/dynamoid/adapter/aws_sdk.rb +96 -16
  60. data/lib/dynamoid/adapter/local.rb +84 -15
  61. data/lib/dynamoid/associations.rb +53 -4
  62. data/lib/dynamoid/associations/association.rb +154 -26
  63. data/lib/dynamoid/associations/belongs_to.rb +32 -6
  64. data/lib/dynamoid/associations/has_and_belongs_to_many.rb +29 -3
  65. data/lib/dynamoid/associations/has_many.rb +30 -4
  66. data/lib/dynamoid/associations/has_one.rb +26 -3
  67. data/lib/dynamoid/components.rb +7 -5
  68. data/lib/dynamoid/config.rb +15 -2
  69. data/lib/dynamoid/config/options.rb +8 -0
  70. data/lib/dynamoid/criteria.rb +7 -2
  71. data/lib/dynamoid/criteria/chain.rb +55 -8
  72. data/lib/dynamoid/document.rb +68 -7
  73. data/lib/dynamoid/errors.rb +17 -2
  74. data/lib/dynamoid/fields.rb +44 -1
  75. data/lib/dynamoid/finders.rb +32 -6
  76. data/lib/dynamoid/indexes.rb +22 -2
  77. data/lib/dynamoid/indexes/index.rb +48 -7
  78. data/lib/dynamoid/persistence.rb +111 -51
  79. data/lib/dynamoid/validations.rb +36 -0
  80. data/spec/app/models/address.rb +2 -1
  81. data/spec/app/models/camel_case.rb +11 -0
  82. data/spec/app/models/magazine.rb +4 -1
  83. data/spec/app/models/sponsor.rb +3 -1
  84. data/spec/app/models/subscription.rb +5 -1
  85. data/spec/app/models/user.rb +10 -1
  86. data/spec/dynamoid/associations/association_spec.rb +67 -1
  87. data/spec/dynamoid/associations/belongs_to_spec.rb +16 -1
  88. data/spec/dynamoid/associations/has_and_belongs_to_many_spec.rb +7 -0
  89. data/spec/dynamoid/associations/has_many_spec.rb +14 -0
  90. data/spec/dynamoid/associations/has_one_spec.rb +10 -1
  91. data/spec/dynamoid/criteria_spec.rb +5 -1
  92. data/spec/dynamoid/document_spec.rb +23 -3
  93. data/spec/dynamoid/fields_spec.rb +10 -1
  94. data/spec/dynamoid/indexes/index_spec.rb +19 -0
  95. data/spec/dynamoid/persistence_spec.rb +24 -0
  96. data/spec/dynamoid/validations_spec.rb +36 -0
  97. metadata +105 -4
data/Dynamoid.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "dynamoid"
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Symonds"]
12
- s.date = "2012-03-15"
12
+ s.date = "2012-03-28"
13
13
  s.description = "Dynamoid is an ORM for Amazon's DynamoDB that supports offline development, associations, querying, and everything else you'd expect from an ActiveRecord-style replacement."
14
14
  s.email = "josh@joshsymonds.com"
15
15
  s.extra_rdoc_files = [
@@ -26,6 +26,56 @@ Gem::Specification.new do |s|
26
26
  "README.markdown",
27
27
  "Rakefile",
28
28
  "VERSION",
29
+ "doc/.nojekyll",
30
+ "doc/Dynamoid.html",
31
+ "doc/Dynamoid/Adapter.html",
32
+ "doc/Dynamoid/Adapter/AwsSdk.html",
33
+ "doc/Dynamoid/Adapter/Local.html",
34
+ "doc/Dynamoid/Associations.html",
35
+ "doc/Dynamoid/Associations/Association.html",
36
+ "doc/Dynamoid/Associations/BelongsTo.html",
37
+ "doc/Dynamoid/Associations/ClassMethods.html",
38
+ "doc/Dynamoid/Associations/HasAndBelongsToMany.html",
39
+ "doc/Dynamoid/Associations/HasMany.html",
40
+ "doc/Dynamoid/Associations/HasOne.html",
41
+ "doc/Dynamoid/Components.html",
42
+ "doc/Dynamoid/Config.html",
43
+ "doc/Dynamoid/Config/Options.html",
44
+ "doc/Dynamoid/Criteria.html",
45
+ "doc/Dynamoid/Criteria/Chain.html",
46
+ "doc/Dynamoid/Criteria/ClassMethods.html",
47
+ "doc/Dynamoid/Document.html",
48
+ "doc/Dynamoid/Document/ClassMethods.html",
49
+ "doc/Dynamoid/Errors.html",
50
+ "doc/Dynamoid/Errors/DocumentNotValid.html",
51
+ "doc/Dynamoid/Errors/Error.html",
52
+ "doc/Dynamoid/Errors/InvalidField.html",
53
+ "doc/Dynamoid/Errors/MissingRangeKey.html",
54
+ "doc/Dynamoid/Fields.html",
55
+ "doc/Dynamoid/Fields/ClassMethods.html",
56
+ "doc/Dynamoid/Finders.html",
57
+ "doc/Dynamoid/Finders/ClassMethods.html",
58
+ "doc/Dynamoid/Indexes.html",
59
+ "doc/Dynamoid/Indexes/ClassMethods.html",
60
+ "doc/Dynamoid/Indexes/Index.html",
61
+ "doc/Dynamoid/Persistence.html",
62
+ "doc/Dynamoid/Persistence/ClassMethods.html",
63
+ "doc/Dynamoid/Validations.html",
64
+ "doc/_index.html",
65
+ "doc/class_list.html",
66
+ "doc/css/common.css",
67
+ "doc/css/full_list.css",
68
+ "doc/css/style.css",
69
+ "doc/file.LICENSE.html",
70
+ "doc/file.README.html",
71
+ "doc/file_list.html",
72
+ "doc/frames.html",
73
+ "doc/index.html",
74
+ "doc/js/app.js",
75
+ "doc/js/full_list.js",
76
+ "doc/js/jquery.js",
77
+ "doc/method_list.html",
78
+ "doc/top-level-namespace.html",
29
79
  "lib/dynamoid.rb",
30
80
  "lib/dynamoid/adapter.rb",
31
81
  "lib/dynamoid/adapter/aws_sdk.rb",
@@ -48,7 +98,9 @@ Gem::Specification.new do |s|
48
98
  "lib/dynamoid/indexes.rb",
49
99
  "lib/dynamoid/indexes/index.rb",
50
100
  "lib/dynamoid/persistence.rb",
101
+ "lib/dynamoid/validations.rb",
51
102
  "spec/app/models/address.rb",
103
+ "spec/app/models/camel_case.rb",
52
104
  "spec/app/models/magazine.rb",
53
105
  "spec/app/models/sponsor.rb",
54
106
  "spec/app/models/subscription.rb",
@@ -71,13 +123,14 @@ Gem::Specification.new do |s|
71
123
  "spec/dynamoid/indexes/index_spec.rb",
72
124
  "spec/dynamoid/indexes_spec.rb",
73
125
  "spec/dynamoid/persistence_spec.rb",
126
+ "spec/dynamoid/validations_spec.rb",
74
127
  "spec/dynamoid_spec.rb",
75
128
  "spec/spec_helper.rb"
76
129
  ]
77
130
  s.homepage = "http://github.com/Veraticus/Dynamoid"
78
131
  s.licenses = ["MIT"]
79
132
  s.require_paths = ["lib"]
80
- s.rubygems_version = "1.8.18"
133
+ s.rubygems_version = "1.8.19"
81
134
  s.summary = "Dynamoid is an ORM for Amazon's DynamoDB"
82
135
 
83
136
  if s.respond_to? :specification_version then
@@ -93,6 +146,9 @@ Gem::Specification.new do |s|
93
146
  s.add_development_dependency(%q<bundler>, [">= 0"])
94
147
  s.add_development_dependency(%q<jeweler>, [">= 0"])
95
148
  s.add_development_dependency(%q<rcov>, [">= 0"])
149
+ s.add_development_dependency(%q<yard>, [">= 0"])
150
+ s.add_development_dependency(%q<redcarpet>, ["= 1.17.2"])
151
+ s.add_development_dependency(%q<github-markup>, [">= 0"])
96
152
  else
97
153
  s.add_dependency(%q<activemodel>, [">= 0"])
98
154
  s.add_dependency(%q<tzinfo>, [">= 0"])
@@ -103,6 +159,9 @@ Gem::Specification.new do |s|
103
159
  s.add_dependency(%q<bundler>, [">= 0"])
104
160
  s.add_dependency(%q<jeweler>, [">= 0"])
105
161
  s.add_dependency(%q<rcov>, [">= 0"])
162
+ s.add_dependency(%q<yard>, [">= 0"])
163
+ s.add_dependency(%q<redcarpet>, ["= 1.17.2"])
164
+ s.add_dependency(%q<github-markup>, [">= 0"])
106
165
  end
107
166
  else
108
167
  s.add_dependency(%q<activemodel>, [">= 0"])
@@ -114,6 +173,9 @@ Gem::Specification.new do |s|
114
173
  s.add_dependency(%q<bundler>, [">= 0"])
115
174
  s.add_dependency(%q<jeweler>, [">= 0"])
116
175
  s.add_dependency(%q<rcov>, [">= 0"])
176
+ s.add_dependency(%q<yard>, [">= 0"])
177
+ s.add_dependency(%q<redcarpet>, ["= 1.17.2"])
178
+ s.add_dependency(%q<github-markup>, [">= 0"])
117
179
  end
118
180
  end
119
181
 
data/Gemfile CHANGED
@@ -16,4 +16,7 @@ group :development do
16
16
  gem "bundler"
17
17
  gem "jeweler"
18
18
  gem "rcov"
19
+ gem "yard"
20
+ gem "redcarpet", '1.17.2'
21
+ gem 'github-markup'
19
22
  end
data/Gemfile.lock CHANGED
@@ -15,6 +15,7 @@ GEM
15
15
  builder (3.0.0)
16
16
  diff-lcs (1.1.3)
17
17
  git (1.2.5)
18
+ github-markup (0.7.1)
18
19
  httparty (0.8.1)
19
20
  multi_json
20
21
  multi_xml
@@ -32,6 +33,7 @@ GEM
32
33
  nokogiri (1.5.0)
33
34
  rake (0.9.2.2)
34
35
  rcov (0.9.11)
36
+ redcarpet (1.17.2)
35
37
  rspec (2.8.0)
36
38
  rspec-core (~> 2.8.0)
37
39
  rspec-expectations (~> 2.8.0)
@@ -42,6 +44,7 @@ GEM
42
44
  rspec-mocks (2.8.0)
43
45
  tzinfo (0.3.31)
44
46
  uuidtools (2.1.2)
47
+ yard (0.7.5)
45
48
 
46
49
  PLATFORMS
47
50
  ruby
@@ -50,9 +53,12 @@ DEPENDENCIES
50
53
  activemodel
51
54
  aws-sdk
52
55
  bundler
56
+ github-markup
53
57
  jeweler
54
58
  mocha
55
59
  rake
56
60
  rcov
61
+ redcarpet (= 1.17.2)
57
62
  rspec
58
63
  tzinfo
64
+ yard
data/README.markdown CHANGED
@@ -22,41 +22,131 @@ Then you need to initialize it to get it going. Put code similar to this somewhe
22
22
  # config.adapter = 'aws_sdk' # This adapter establishes a connection to the DynamoDB servers using Amazon's own AWS gem.
23
23
  # config.access_key = 'access_key' # If connecting to DynamoDB, your access key is required.
24
24
  # config.secret_key = 'secret_key' # So is your secret key.
25
- config.namespace = "dynamoid_#{Rails.application.class.parent_name}_#{Rails.env}" # To namespace tables created by Dynamoid from other tables you might have.
25
+ config.namespace = "dynamoid_app_development" # To namespace tables created by Dynamoid from other tables you might have.
26
26
  config.warn_on_scan = true # Output a warning to the logger when you perform a scan rather than a query on a table.
27
27
  config.partitioning = true # Spread writes randomly across the database. See "partitioning" below for more.
28
28
  config.partition_size = 200 # Determine the key space size that writes are randomly spread across.
29
+ config.read_capacity = 100 # Read capacity for your tables
30
+ config.write_capacity = 20 # Write capacity for your tables
29
31
  end
30
32
 
31
33
  ```
32
34
 
33
- Once you have the configuration set up, just define models like this:
35
+ Once you have the configuration set up, you need to move on to making models.
36
+
37
+ ## Setup
38
+
39
+ You *must* include ```Dynamoid::Document``` in every Dynamoid model.
34
40
 
35
41
  ```ruby
36
42
  class User
37
- include Dynamoid::Document # Documents automatically receive an 'id' field: you don't have to specify it.
43
+ include Dynamoid::Document
44
+
45
+ end
46
+ ```
47
+
48
+ ### Fields
49
+
50
+ You'll have to define all the fields on the model and the data type of each field. Every field on the object must be included here; if you miss any they'll be completely bypassed during DynamoDB's initialization and will not appear on the model objects.
51
+
52
+ By default, fields are assumed to be of type ```:string```. But you can also use ```:integer```, ```:float```, ```:set```, ```:array```, ```:datetime```, and ```:serialized```. You get magic columns of id (string), created_at (datetime), and updated_at (datetime) for free.
53
+
54
+ ```ruby
55
+ class User
56
+ include Dynamoid::Document
57
+
58
+ field :name
59
+ field :email
60
+ field :rank, :integer
61
+ field :number, :float
62
+ field :joined_at, :datetime
63
+ field :hash, :serialized
38
64
 
39
- field :name # Every field you have on the object must be specified here.
40
- field :email # If you have fields that aren't specified they won't be attached to the object as methods.
41
- field :rank, :integer # Every field is assumed to be a string unless otherwise specified.
42
- # created_at and updated_at with a type of :datetime are automatically added.
65
+ end
66
+ ```
67
+
68
+ ### Indexes
69
+
70
+ You can also define indexes on fields, combinations of fields, and one range field. Yes, only one range field: in DynamoDB tables can have at most one range index, so make good use of it! To make an index, just specify the fields you want it on, either single or in an array. If the entire index is a range, pass ```:range => true```. Otherwise, pass the attribute that will become the range key. The only range attributes you can use right now are integers, floats, and datetimes. If you pass a string as a range key likely DynamoDB will complain a lot.
71
+
72
+ ```ruby
73
+ class User
74
+ include Dynamoid::Document
75
+
76
+ ...
77
+
78
+ index :name
79
+ index :email
80
+ index [:name, :email]
81
+ index :created_at, :range => true
82
+ index :name, :range => :joined_at
83
+
84
+ end
85
+ ```
86
+
87
+ ### Associations
88
+
89
+ Just like in ActiveRecord (or your other favorite ORM), Dynamoid uses associations to create links between models.
90
+
91
+ The only supported associations (so far) are ```has_many```, ```has_one```, ```has_and_belongs_to_many```, and ```belongs_to```. Associations are very simple to create: just specify the type, the name, and then any options you'd like to pass to the association. If there's an inverse association either inferred or specified directly, Dynamoid will update both objects to point at each other.
92
+
93
+ ```ruby
94
+ class User
95
+ include Dynamoid::Document
96
+
97
+ ...
43
98
 
44
- index :name # Only specify indexes if you intend to perform queries on the specified fields.
45
- index :email # Fields without indexes suffer extremely poor performance as they must use
46
- index [:name, :email] # scan rather than query.
47
- index :created_at, :range => true
48
- index :name, :range => :created_at
49
- # You can only provide one range query for each index, or specify an index
50
- # to be only a range query with :range => true.
99
+ has_many :addresses
100
+ has_many :students, :class => User
101
+ belongs_to :teacher, :class_name => :user
102
+ belongs_to :group
103
+ has_one :role
104
+ has_and_belongs_to_many :friends, :inverse_of => :friending_users
51
105
 
52
- has_many :addresses # Associations do not accept any options presently. The referenced
53
- # model name must match exactly and the foreign key is always id.
54
- belongs_to :group # If they detect a matching association on
55
- # the referenced model they'll auto-update that association.
56
- has_one :role # Contrary to ActiveRecord, all associations are stored on the object,
57
- # even if it seems like they'd be a foreign key association.
58
- has_and_belongs_to_many :friends
59
- # There's no concept of embedding models yet but it's coming!
106
+ end
107
+
108
+ class Address
109
+ include Dynamoid::Document
110
+
111
+ ...
112
+
113
+ belongs_to :address # Automatically links up with the user model
114
+
115
+ end
116
+ ```
117
+
118
+ Contrary to what you'd expect, association information is always contained on the object specifying the association, even if it seems like the association has a foreign key. This is a side effect of DynamoDB's structure: it's very difficult to find foreign keys without an index. Usually you won't find this to be a problem, but it does mean that association methods that build new models will not work correctly -- for example, ```user.addresses.new``` returns an address that is not associated to the user. We'll be correcting this soon.
119
+
120
+ ### Validations
121
+
122
+ Dynamoid bakes in ActiveModel validations, just like ActiveRecord does.
123
+
124
+ ```ruby
125
+ class User
126
+ include Dynamoid::Document
127
+
128
+ ...
129
+
130
+ validates_presence_of :name
131
+ validates_format_of :email, :with => /@/
132
+ end
133
+ ```
134
+
135
+ To see more usage and examples of ActiveModel validations, check out the [ActiveModel validation documentation](http://api.rubyonrails.org/classes/ActiveModel/Validations.html).
136
+
137
+ ### Callbacks
138
+
139
+ Dynamoid also employs ActiveModel callbacks. Right now, callbacks are defined on ```save```, ```update```, ```destroy```, which allows you to do ```before_``` or ```after_``` any of those.
140
+
141
+ ```ruby
142
+ class User
143
+ include Dynamoid::Document
144
+
145
+ ...
146
+
147
+ before_save :set_default_password
148
+ after_create :notify_friends
149
+ after_destroy :delete_addresses
60
150
  end
61
151
  ```
62
152
 
@@ -121,6 +211,11 @@ When your read or write provisioning exceed your table's allowed throughput, Dyn
121
211
 
122
212
  Dynamoid borrows code, structure, and even its name very liberally from the truly amazing [Mongoid](https://github.com/mongoid/mongoid). Without Mongoid to crib from none of this would have been possible, and I hope they don't mind me reusing their very awesome ideas to make DynamoDB just as accessible to the Ruby world as MongoDB.
123
213
 
214
+ Also, without contributors the project wouldn't be nearly as awesome. So many thanks to:
215
+
216
+ * [Anantha Kumaran](https://github.com/ananthakumaran)
217
+ * [Jason Dew](https://github.com/jasondew)
218
+
124
219
  ## Running the tests
125
220
 
126
221
  The tests can be run in the simple predictable way with ```rake```. However, if you provide environment variables for ACCESS_KEY and SECRET_KEY, the tests will use the aws_sdk adapter rather than the local adapter: ```ACCESS_KEY=<accesskey> SECRET_KEY=<secretkey> rake```. Keep in mind this takes much, much longer than the local tests.
data/Rakefile CHANGED
@@ -36,14 +36,27 @@ RSpec::Core::RakeTask.new(:rcov) do |spec|
36
36
  spec.rcov = true
37
37
  end
38
38
 
39
- task :default => :spec
40
-
41
- require 'rake/rdoctask'
42
- Rake::RDocTask.new do |rdoc|
43
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
39
+ require 'yard'
40
+ YARD::Rake::YardocTask.new do |t|
41
+ t.files = ['lib/**/*.rb', "README", "LICENSE"] # optional
42
+ t.options = ['-m', 'markdown'] # optional
43
+ end
44
44
 
45
- rdoc.rdoc_dir = 'rdoc'
46
- rdoc.title = "dynamoid #{version}"
47
- rdoc.rdoc_files.include('README*')
48
- rdoc.rdoc_files.include('lib/**/*.rb')
45
+ desc 'Publish documentation to gh-pages'
46
+ task :publish do
47
+ Rake::Task['yard'].invoke
48
+ `git add .`
49
+ `git commit -m 'Regenerated documentation'`
50
+ `git checkout gh-pages`
51
+ `git clean -fdx`
52
+ `git checkout master -- doc`
53
+ `cp -R doc/* .`
54
+ `git rm -rf doc/`
55
+ `git add .`
56
+ `git commit -m 'Regenerated documentation'`
57
+ `git pull`
58
+ `git push`
59
+ `git checkout master`
49
60
  end
61
+
62
+ task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
data/doc/.nojekyll ADDED
File without changes
data/doc/Dynamoid.html ADDED
@@ -0,0 +1,300 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: Dynamoid
8
+
9
+ &mdash; Documentation by YARD 0.7.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="_index.html">Index (D)</a> &raquo;
37
+
38
+
39
+ <span class="title">Dynamoid</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Module: Dynamoid
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+
68
+
69
+ <dt class="r1">Extended by:</dt>
70
+ <dd class="r1"><span class='object_link'><a href="" title="Dynamoid (module)">Dynamoid</a></span></dd>
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dt class="r2">Included in:</dt>
78
+ <dd class="r2"><span class='object_link'><a href="" title="Dynamoid (module)">Dynamoid</a></span></dd>
79
+
80
+
81
+
82
+ <dt class="r1 last">Defined in:</dt>
83
+ <dd class="r1 last">lib/dynamoid/fields.rb<span class="defines">,<br />
84
+ lib/dynamoid.rb,<br /> lib/dynamoid/errors.rb,<br /> lib/dynamoid/config.rb,<br /> lib/dynamoid/finders.rb,<br /> lib/dynamoid/adapter.rb,<br /> lib/dynamoid/indexes.rb,<br /> lib/dynamoid/document.rb,<br /> lib/dynamoid/criteria.rb,<br /> lib/dynamoid/components.rb,<br /> lib/dynamoid/persistence.rb,<br /> lib/dynamoid/validations.rb,<br /> lib/dynamoid/associations.rb,<br /> lib/dynamoid/indexes/index.rb,<br /> lib/dynamoid/adapter/local.rb,<br /> lib/dynamoid/criteria/chain.rb,<br /> lib/dynamoid/config/options.rb,<br /> lib/dynamoid/adapter/aws_sdk.rb,<br /> lib/dynamoid/associations/has_one.rb,<br /> lib/dynamoid/associations/has_many.rb,<br /> lib/dynamoid/associations/belongs_to.rb,<br /> lib/dynamoid/associations/association.rb,<br /> lib/dynamoid/associations/has_and_belongs_to_many.rb</span>
85
+ </dd>
86
+
87
+ </dl>
88
+ <div class="clear"></div>
89
+
90
+ <h2>Overview</h2><div class="docstring">
91
+ <div class="discussion">
92
+ <p>:nodoc:</p>
93
+
94
+
95
+ </div>
96
+ </div>
97
+ <div class="tags">
98
+
99
+
100
+ </div><h2>Defined Under Namespace</h2>
101
+ <p class="children">
102
+
103
+
104
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Dynamoid/Adapter.html" title="Dynamoid::Adapter (module)">Adapter</a></span>, <span class='object_link'><a href="Dynamoid/Associations.html" title="Dynamoid::Associations (module)">Associations</a></span>, <span class='object_link'><a href="Dynamoid/Components.html" title="Dynamoid::Components (module)">Components</a></span>, <span class='object_link'><a href="Dynamoid/Config.html" title="Dynamoid::Config (module)">Config</a></span>, <span class='object_link'><a href="Dynamoid/Criteria.html" title="Dynamoid::Criteria (module)">Criteria</a></span>, <span class='object_link'><a href="Dynamoid/Document.html" title="Dynamoid::Document (module)">Document</a></span>, <span class='object_link'><a href="Dynamoid/Errors.html" title="Dynamoid::Errors (module)">Errors</a></span>, <span class='object_link'><a href="Dynamoid/Fields.html" title="Dynamoid::Fields (module)">Fields</a></span>, <span class='object_link'><a href="Dynamoid/Finders.html" title="Dynamoid::Finders (module)">Finders</a></span>, <span class='object_link'><a href="Dynamoid/Indexes.html" title="Dynamoid::Indexes (module)">Indexes</a></span>, <span class='object_link'><a href="Dynamoid/Persistence.html" title="Dynamoid::Persistence (module)">Persistence</a></span>, <span class='object_link'><a href="Dynamoid/Validations.html" title="Dynamoid::Validations (module)">Validations</a></span>
105
+
106
+
107
+
108
+
109
+ </p>
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ <h2>
119
+ Instance Method Summary
120
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
121
+ </h2>
122
+
123
+ <ul class="summary">
124
+
125
+ <li class="public ">
126
+ <span class="summary_signature">
127
+
128
+ <a href="#configure-instance_method" title="#configure (instance method)">- (Object) <strong>configure</strong> </a>
129
+
130
+
131
+
132
+ (also: #config)
133
+
134
+ </span>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <span class="summary_desc"><div class='inline'></div></span>
144
+
145
+ </li>
146
+
147
+
148
+ <li class="public ">
149
+ <span class="summary_signature">
150
+
151
+ <a href="#included_models-instance_method" title="#included_models (instance method)">- (Object) <strong>included_models</strong> </a>
152
+
153
+
154
+
155
+ </span>
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+ <span class="summary_desc"><div class='inline'></div></span>
165
+
166
+ </li>
167
+
168
+
169
+ <li class="public ">
170
+ <span class="summary_signature">
171
+
172
+ <a href="#logger-instance_method" title="#logger (instance method)">- (Object) <strong>logger</strong> </a>
173
+
174
+
175
+
176
+ </span>
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+ <span class="summary_desc"><div class='inline'></div></span>
186
+
187
+ </li>
188
+
189
+
190
+ </ul>
191
+
192
+
193
+
194
+
195
+ <div id="instance_method_details" class="method_details_list">
196
+ <h2>Instance Method Details</h2>
197
+
198
+
199
+ <div class="method_details first">
200
+ <p class="signature first" id="configure-instance_method">
201
+
202
+ - (<tt>Object</tt>) <strong>configure</strong>
203
+
204
+
205
+
206
+ <span class="aliases">Also known as:
207
+ <span class="names"><span id='config-instance_method'>config</span></span>
208
+ </span>
209
+
210
+ </p><table class="source_code">
211
+ <tr>
212
+ <td>
213
+ <pre class="lines">
214
+
215
+
216
+ 27
217
+ 28
218
+ 29
219
+ 30</pre>
220
+ </td>
221
+ <td>
222
+ <pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line 27</span>
223
+
224
+ <span class='kw'>def</span> <span class='id identifier rubyid_configure'>configure</span>
225
+ <span class='id identifier rubyid_block_given?'>block_given?</span> <span class='op'>?</span> <span class='kw'>yield</span><span class='lparen'>(</span><span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span>
226
+ <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Adapter</span><span class='period'>.</span><span class='id identifier rubyid_reconnect!'>reconnect!</span>
227
+ <span class='kw'>end</span></pre>
228
+ </td>
229
+ </tr>
230
+ </table>
231
+ </div>
232
+
233
+ <div class="method_details ">
234
+ <p class="signature " id="included_models-instance_method">
235
+
236
+ - (<tt>Object</tt>) <strong>included_models</strong>
237
+
238
+
239
+
240
+ </p><table class="source_code">
241
+ <tr>
242
+ <td>
243
+ <pre class="lines">
244
+
245
+
246
+ 37
247
+ 38
248
+ 39</pre>
249
+ </td>
250
+ <td>
251
+ <pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line 37</span>
252
+
253
+ <span class='kw'>def</span> <span class='id identifier rubyid_included_models'>included_models</span>
254
+ <span class='ivar'>@included_models</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
255
+ <span class='kw'>end</span></pre>
256
+ </td>
257
+ </tr>
258
+ </table>
259
+ </div>
260
+
261
+ <div class="method_details ">
262
+ <p class="signature " id="logger-instance_method">
263
+
264
+ - (<tt>Object</tt>) <strong>logger</strong>
265
+
266
+
267
+
268
+ </p><table class="source_code">
269
+ <tr>
270
+ <td>
271
+ <pre class="lines">
272
+
273
+
274
+ 33
275
+ 34
276
+ 35</pre>
277
+ </td>
278
+ <td>
279
+ <pre class="code"><span class="info file"># File 'lib/dynamoid.rb', line 33</span>
280
+
281
+ <span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
282
+ <span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Config</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span>
283
+ <span class='kw'>end</span></pre>
284
+ </td>
285
+ </tr>
286
+ </table>
287
+ </div>
288
+
289
+ </div>
290
+
291
+ </div>
292
+
293
+ <div id="footer">
294
+ Generated on Tue Mar 27 17:53:05 2012 by
295
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
296
+ 0.7.5 (ruby-1.9.3).
297
+ </div>
298
+
299
+ </body>
300
+ </html>