Method: LHS::Record::Endpoints::ClassMethods#endpoint

Defined in:
lib/lhs/concerns/record/endpoints.rb

#endpoint(url, options = nil) ⇒ Object

Adds the endpoint to the list of endpoints.



16
17
18
19
20
21
22
23
24
25
# File 'lib/lhs/concerns/record/endpoints.rb', line 16

def endpoint(url, options = nil)
  class_attribute :endpoints unless defined? endpoints
  self.endpoints ||= []
  self.endpoints = endpoints.clone
  endpoint = LHC::Endpoint.new(url, options)
  sanity_check(endpoint)
  endpoints.push(endpoint)
  LHS::Record::Endpoints.all ||= {}
  LHS::Record::Endpoints.all[url] = self
end