Module: Resourceful::Simple

Included in:
Resourceful
Defined in:
lib/resourceful/simple.rb

Instance Method Summary collapse

Instance Method Details

#add_authenticator(an_authenticator) ⇒ Object



11
12
13
# File 'lib/resourceful/simple.rb', line 11

def add_authenticator(an_authenticator)
  default_accessor.add_authenticator(an_authenticator)
end

#default_accessorObject



7
8
9
# File 'lib/resourceful/simple.rb', line 7

def default_accessor
  @default_accessor ||= Resourceful::HttpAccessor.new
end

#delete(uri, header = {}) ⇒ Object



23
24
25
# File 'lib/resourceful/simple.rb', line 23

def delete(uri, header = {})
  request(:delete, uri, header)
end

#get(uri, header = {}) ⇒ Object



15
16
17
# File 'lib/resourceful/simple.rb', line 15

def get(uri, header = {})
  request(:get, uri, header)
end

#head(uri, header = {}) ⇒ Object



19
20
21
# File 'lib/resourceful/simple.rb', line 19

def head(uri, header = {})
  request(:head, uri, header)
end

#post(uri, data = nil, header = {}) ⇒ Object



27
28
29
# File 'lib/resourceful/simple.rb', line 27

def post(uri, data = nil, header = {})
  request(:post, uri, header, data)
end

#put(uri, data = nil, header = {}) ⇒ Object



31
32
33
# File 'lib/resourceful/simple.rb', line 31

def put(uri, data = nil, header = {})
  request(:put, uri, header, data)
end

#request(method, uri, header = {}, data = nil) ⇒ Object



3
4
5
# File 'lib/resourceful/simple.rb', line 3

def request(method, uri, header = {}, data = nil)
  default_accessor.resource(uri).request(method, data, header)
end