motion-loco 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +37 -1
- data/lib/motion-loco/savable.rb +2 -0
- data/lib/motion-loco/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDUzNjAyZjM3YWVhYzM3ZjgyZTJlYjkzZmE2NjY2ODI0NTc3ZjU5YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTI3YTRjMDEwNzQ5M2FjZjQyYjU2MWU2YWIyY2FlOTI5MTRhOGZiZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTA2ODIxODZkY2M0NzgyMTMxZGM2YmM0NDAzYTQ1MGJlNzA5ZmNjNzEzOTJj
|
10
|
+
ZjM2NWU3NmZkM2Y0ZTQ4ZDUwY2ZlZWZlMTg2ZTI5YjRjYzNhNzJiY2Q2ODA5
|
11
|
+
Njk3MThkZGY4MzNiNTUzMjYwMmQ0N2E3ODEzMzZlNDg1ZTZiMmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
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
|
data/lib/motion-loco/savable.rb
CHANGED
data/lib/motion-loco/version.rb
CHANGED