Module: Tend::Util::Ht::InstanceMethods

Defined in:
lib/tend/util/ht.rb

Instance Method Summary collapse

Instance Method Details

#delete(options = {}) ⇒ Object



38
39
40
41
42
# File 'lib/tend/util/ht.rb', line 38

def delete options = {}
  o = extract_options options.merge(id: id, no_pagination: true)
  initialize self.class.send( :handle_response, HTTParty.delete( uri(o), :basic_auth => o.auth ) )[:data]
  self
end

#get(options = {}) ⇒ Object



50
51
52
# File 'lib/tend/util/ht.rb', line 50

def get options = {}
  self.class.get options
end

#update(attributes, options = {}) ⇒ Object



44
45
46
47
48
# File 'lib/tend/util/ht.rb', line 44

def update attributes, options = {}
  o = extract_options options.merge(id: id, no_pagination: true)
  initialize self.class.send( :handle_response, HTTParty.put( uri(o), body: attributes, :basic_auth => o.auth ) )[:data]
  self
end