Class: Apipony::Section
- Inherits:
-
Object
- Object
- Apipony::Section
- Defined in:
- lib/apipony/section.rb
Overview
A section is a way to logically separate your endpoints. All endpoints in a section should be related in some way.
Instance Attribute Summary collapse
-
#endpoints ⇒ Object
:nodoc: This contains an array of endpoints added with the ‘endpoint` method of the DSL.
-
#title ⇒ Object
What to call this endpoint.
Instance Method Summary collapse
- #endpoint(method, url, &block) ⇒ Object
-
#initialize(title, &block) ⇒ Section
constructor
A new instance of Section.
Constructor Details
#initialize(title, &block) ⇒ Section
Returns a new instance of Section.
13 14 15 16 17 18 |
# File 'lib/apipony/section.rb', line 13 def initialize(title, &block) @title = title @endpoints = [] instance_eval(&block) end |
Instance Attribute Details
#endpoints ⇒ Object
:nodoc: This contains an array of endpoints added with the ‘endpoint` method of the DSL
12 13 14 |
# File 'lib/apipony/section.rb', line 12 def endpoints @endpoints end |
#title ⇒ Object
What to call this endpoint. This will show up on the generated page.
7 8 9 |
# File 'lib/apipony/section.rb', line 7 def title @title end |