Class: Kanpachi::DSL::Section
- Inherits:
-
Object
- Object
- Kanpachi::DSL::Section
- Defined in:
- lib/kanpachi/dsl/section.rb
Instance Method Summary collapse
-
#description(description) ⇒ String
Sets the description.
-
#initialize(section, api_dsl) ⇒ Section
constructor
Constructor.
- #resource(*attrs, &block) ⇒ Object
Constructor Details
#initialize(section, api_dsl) ⇒ Section
Constructor
8 9 10 11 |
# File 'lib/kanpachi/dsl/section.rb', line 8 def initialize(section, api_dsl) @section = section @api_dsl = api_dsl end |
Instance Method Details
#description(description) ⇒ String
Sets the description
18 19 20 |
# File 'lib/kanpachi/dsl/section.rb', line 18 def description(description) @section.description = description end |
#resource(*attrs, &block) ⇒ Object
22 23 24 25 26 |
# File 'lib/kanpachi/dsl/section.rb', line 22 def resource(*attrs, &block) res = @api_dsl.resource(*attrs, &block) @section.routes << [res.http_verb, res.url] res end |