Module: Singly::Endpoint::ClassMethods
- Defined in:
- lib/singly/endpoint.rb
Instance Method Summary collapse
- #endpoint(http_method, route, params = {}) ⇒ Object
- #http_method ⇒ Object
- #optional_params ⇒ Object
- #required_params ⇒ Object
- #route ⇒ Object
Instance Method Details
#endpoint(http_method, route, params = {}) ⇒ Object
114 115 116 117 118 |
# File 'lib/singly/endpoint.rb', line 114 def endpoint(http_method, route, params={}) @http_method = http_method @route = route @params = params end |
#http_method ⇒ Object
98 99 100 |
# File 'lib/singly/endpoint.rb', line 98 def http_method @http_method || :get end |
#optional_params ⇒ Object
110 111 112 |
# File 'lib/singly/endpoint.rb', line 110 def optional_params (@params && @params[:optional]) || [] end |
#required_params ⇒ Object
106 107 108 |
# File 'lib/singly/endpoint.rb', line 106 def required_params (@params && @params[:required]) || [] end |
#route ⇒ Object
102 103 104 |
# File 'lib/singly/endpoint.rb', line 102 def route @route || "" end |