motion-loco 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGRkOWJhYjFhZWU5NzE3ODYyYTJlYzIxM2QzODU2NTcwMmY1YzY1Ng==
4
+ NDUzNjAyZjM3YWVhYzM3ZjgyZTJlYjkzZmE2NjY2ODI0NTc3ZjU5YQ==
5
5
  data.tar.gz: !binary |-
6
- OTVjMGJkMjcyZDdlYTdjZmM3NzliMDJiMDVlMWVlYTcyY2RlMDA1OA==
6
+ ZTI3YTRjMDEwNzQ5M2FjZjQyYjU2MWU2YWIyY2FlOTI5MTRhOGZiZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OWEzMjJlOTk5MTY0OTk1YjZlZTAyNjFjMmU5OGJkMTFhOTI5YTdmYmJkYWNh
10
- NWE1MTczMWQ2YWMyOTZlZjA4ZjY1NGRlMWUzMjZkMWFjYmI0NTIyMjcwY2Fi
11
- NTgxM2RiYTJmZjM0ZmNjNDEwOTAxY2U0ZjU3ZDZiMGI0NzhlYjQ=
9
+ ZTA2ODIxODZkY2M0NzgyMTMxZGM2YmM0NDAzYTQ1MGJlNzA5ZmNjNzEzOTJj
10
+ ZjM2NWU3NmZkM2Y0ZTQ4ZDUwY2ZlZWZlMTg2ZTI5YjRjYzNhNzJiY2Q2ODA5
11
+ Njk3MThkZGY4MzNiNTUzMjYwMmQ0N2E3ODEzMzZlNDg1ZTZiMmU=
12
12
  data.tar.gz: !binary |-
13
- Y2MwODBiMjk1MTAwNDMzZjYxZTkwNzE0MDU5NjYzYTJkMDljNTNhNzlkZGUw
14
- MmVkZThiZDJkZDIwODUwMDA4YjdjYzY0M2YxZjY3OWVjZWE1NDg2MTc5Yjg4
15
- YWViNjJlODgxMmVhYTNhN2Q0ZGM3ODZlYTAxMWM3MGM4MjcyZjk=
13
+ MWFiNzQ4MmZlYzA2ZGFhYTcwZmM0ODA3MjdjOGFlZGUwY2FlNWEwNmNjMGI2
14
+ NzM1ODU4NmY5ZGRlNTUyYWJiMDAyOGIzYTBhN2I3ZDYzNWFlMzEzZjVkM2E1
15
+ Mzk1MDg0NzVjZjY0ODQxZmQzOWQwNDhmZTQ2Zjg3MzZjN2JiOGI=
data/README.md CHANGED
@@ -169,7 +169,43 @@ class Post < Loco::Model
169
169
  property :body
170
170
  end
171
171
 
172
- @post = Post.new(title: 'New! The Loco::RESTAdapter', body: 'Yay! A REST data adapter!')
172
+ # GET http://localhost:3000/posts/1.json
173
+ # {
174
+ # "post": {
175
+ # "id": 1,
176
+ # "title": "My first blog post",
177
+ # "body": "Check out RubyMotion!"
178
+ # }
179
+ # }
180
+ @post = Post.find(1) do |post|
181
+ post.id # 1
182
+ post.title # "My first blog post"
183
+ post.body # "Check out RubyMotion!"
184
+ end
185
+
186
+ # GET http://localhost:3000/posts.json
187
+ # {
188
+ # "posts": [
189
+ # {
190
+ # "id": 1,
191
+ # "title": "My first blog post",
192
+ # "body": "Check out RubyMotion!"
193
+ # },
194
+ # {
195
+ # "id": 2,
196
+ # "title": "And for my next post...",
197
+ # "body": "Like RubyMotion and Ember.js? Check out Motion-Loco on GitHub."
198
+ # }
199
+ # ]
200
+ # }
201
+ @posts = Post.all do |posts|
202
+ posts.length # 2
203
+ end
204
+
205
+ # Started POST "/posts.json"
206
+ # Processing by PostsController#create as JSON
207
+ # Parameters: {"post"=>{"title"=>"Loco::RESTAdapter can save!", "body"=>"Hopefully."}}
208
+ @post = Post.new(title: 'Loco::RESTAdapter can save!', body: 'Hopefully.')
173
209
  @post.save do |post|
174
210
  post.id # Yay! It has an ID now!
175
211
  end
@@ -109,6 +109,8 @@ module Loco
109
109
  end
110
110
  end
111
111
  end
112
+ alias_method :all, :find
113
+ alias_method :where, :find
112
114
 
113
115
  def get_class_adapter
114
116
  @adapter ||= Adapter.new
@@ -1,3 +1,3 @@
1
1
  module Loco
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-loco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison