Module: Singly::Endpoint::ClassMethods

Defined in:
lib/singly/endpoint.rb

Instance Method Summary collapse

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_methodObject



98
99
100
# File 'lib/singly/endpoint.rb', line 98

def http_method
  @http_method || :get
end

#optional_paramsObject



110
111
112
# File 'lib/singly/endpoint.rb', line 110

def optional_params
  (@params && @params[:optional]) || []
end

#required_paramsObject



106
107
108
# File 'lib/singly/endpoint.rb', line 106

def required_params
  (@params && @params[:required]) || []
end

#routeObject



102
103
104
# File 'lib/singly/endpoint.rb', line 102

def route
  @route || ""
end