File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,40 @@ $ rackup
1919[2013-06-20 08:57:58] INFO WEBrick::HTTPServer#start: pid=247 port=9292
2020```
2121
22+ Try with Hyperclient and ` irb ` .
23+
24+ ```
25+ require 'hyperclient'
26+ ```
27+
28+ Create some splines.
29+
30+ ``` ruby
31+ client = Hyperclient .new (' http://localhost:9292/api' )
32+
33+ 3 .times do |i |
34+ client.splines._post (spline: { name: i.to_s, reticulated: [true , false ].sample })
35+ end
36+ ```
37+
38+ Show splines.
39+
40+ ``` ruby
41+ client = Hyperclient .new (' http://localhost:9292/api' )
42+
43+ client.splines.each do |spline |
44+ puts " spline #{ spline.id } #{ spline.reticulated ? ' is' : ' is not' } reticulated"
45+ end
46+ ```
47+
48+ Delete splines.
49+
50+ ``` ruby
51+ client = Hyperclient .new (' http://localhost:9292/api' )
52+
53+ client.splines.each(& :_delete )
54+ ```
55+
2256### Hello World
2357
2458Navigate to [ localhost:9292/api] ( http://localhost:9292/api ) with a browser. This is a hypermedia API, so all links are clickable.
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module PaginatedPresenter
1111 end
1212
1313 link :next do |opts |
14- "#{ request_url ( opts ) } #{ query_string_for_cursor ( represented [ :next ] , opts ) } " if represented . key? ( :next )
14+ "#{ request_url ( opts ) } #{ query_string_for_cursor ( represented [ :next ] , opts ) } " if represented [ :next ]
1515 end
1616
1717 private
You can’t perform that action at this time.
0 commit comments