Module: Harpy

Defined in:
lib/harpy.rb,
lib/harpy/client.rb,
lib/harpy/resource.rb,
lib/harpy/collection.rb,
lib/harpy/entry_point.rb

Defined Under Namespace

Modules: Resource Classes: BodyToBig, Client, ClientError, ClientTimeout, Collection, EntryPoint, EntryPointRequired, Exception, InvalidResponseCode, Unauthorized, UrlRequired

Class Method Summary collapse

Class Method Details

.clientObject



22
23
24
# File 'lib/harpy.rb', line 22

def self.client
  @client ||= Client.new
end

.client=(new_client) ⇒ Object



18
19
20
# File 'lib/harpy.rb', line 18

def self.client=(new_client)
  @client = new_client
end

.entry_pointObject



38
39
40
# File 'lib/harpy.rb', line 38

def self.entry_point
  @entry_point || raise(EntryPointRequired, 'you can setup one with Harpy.entry_point_url = "http://localhost"')
end

.entry_point=(value) ⇒ Object



34
35
36
# File 'lib/harpy.rb', line 34

def self.entry_point=(value)
  @entry_point = value
end

.entry_point_urlObject



30
31
32
# File 'lib/harpy.rb', line 30

def self.entry_point_url
  @entry_point.url if @entry_point
end

.entry_point_url=(url) ⇒ Object



26
27
28
# File 'lib/harpy.rb', line 26

def self.entry_point_url=(url)
  @entry_point = EntryPoint.new url
end

.resetObject



42
43
44
45
# File 'lib/harpy.rb', line 42

def self.reset
  @client = nil
  @entry_point = nil
end