Class: Sinatra::Schema::DSL::Resources
- Inherits:
-
Object
- Object
- Sinatra::Schema::DSL::Resources
- Defined in:
- lib/sinatra/schema/dsl/resources.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#resource ⇒ Object
Returns the value of attribute resource.
Instance Method Summary collapse
- #delete(href = "/", &blk) ⇒ Object
- #description(description) ⇒ Object
- #get(href = "/", &blk) ⇒ Object
-
#initialize(app, path) ⇒ Resources
constructor
A new instance of Resources.
- #patch(href = "/", &blk) ⇒ Object
- #post(href = "/", &blk) ⇒ Object
- #property ⇒ Object
- #put(href = "/", &blk) ⇒ Object
Constructor Details
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
5 6 7 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 5 def app @app end |
#resource ⇒ Object
Returns the value of attribute resource.
5 6 7 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 5 def resource @resource end |
Instance Method Details
#delete(href = "/", &blk) ⇒ Object
20 21 22 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 20 def delete(href="/", &blk) build_link(:delete, href, &blk) end |
#description(description) ⇒ Object
12 13 14 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 12 def description(description) @resource.description = description end |
#get(href = "/", &blk) ⇒ Object
24 25 26 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 24 def get(href="/", &blk) build_link(:get, href, &blk) end |
#patch(href = "/", &blk) ⇒ Object
28 29 30 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 28 def patch(href="/", &blk) build_link(:patch, href, &blk) end |
#post(href = "/", &blk) ⇒ Object
32 33 34 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 32 def post(href="/", &blk) build_link(:post, href, &blk) end |
#property ⇒ Object
16 17 18 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 16 def property DSL::Definitions.new(resource, [resource.defs, resource.properties]) end |
#put(href = "/", &blk) ⇒ Object
36 37 38 |
# File 'lib/sinatra/schema/dsl/resources.rb', line 36 def put(href="/", &blk) build_link(:put, href, &blk) end |