Class: Apipony::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/apipony/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, &block) ⇒ Section

Returns a new instance of Section.



4
5
6
7
8
9
# File 'lib/apipony/section.rb', line 4

def initialize(title, &block)
  @title = title
  @endpoints = []

  instance_eval(&block)
end

Instance Attribute Details

#endpointsObject

Returns the value of attribute endpoints.



2
3
4
# File 'lib/apipony/section.rb', line 2

def endpoints
  @endpoints
end

#titleObject

Returns the value of attribute title.



2
3
4
# File 'lib/apipony/section.rb', line 2

def title
  @title
end

Instance Method Details

#endpoint(method, url, &block) ⇒ Object



11
12
13
# File 'lib/apipony/section.rb', line 11

def endpoint(method, url, &block)
  @endpoints << Apipony::Endpoint.new(method, url, &block)
end