Class: Fern::Api::Endpoint
- Inherits:
-
Object
- Object
- Fern::Api::Endpoint
- Defined in:
- lib/fern/api/endpoint.rb
Instance Method Summary collapse
-
#initialize(controller, name:, &block) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #request(&block) ⇒ Object
Constructor Details
#initialize(controller, name:, &block) ⇒ Endpoint
Returns a new instance of Endpoint.
4 5 6 7 8 9 |
# File 'lib/fern/api/endpoint.rb', line 4 def initialize(controller, name:, &block) @controller = controller @name = name instance_eval(&block) end |
Instance Method Details
#request(&block) ⇒ Object
11 12 13 |
# File 'lib/fern/api/endpoint.rb', line 11 def request(&block) @controller.send(:define_method, @name, &block) end |