Class: HelloFax::API

Inherits:
Object
  • Object
show all
Includes:
HTTMultiParty
Defined in:
lib/hello_fax.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username, password, guid) ⇒ API

Returns a new instance of API.



14
15
16
17
# File 'lib/hello_fax.rb', line 14

def initialize(username, password, guid)
  self.class.basic_auth username, password
  @guid = guid
end

Instance Attribute Details

#guidObject

Returns the value of attribute guid.



12
13
14
# File 'lib/hello_fax.rb', line 12

def guid
  @guid
end

Instance Method Details

#account_detailsObject



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

def 
  self.class.get("/Accounts/#{@guid}")
end

#fax_linesObject



35
36
37
# File 'lib/hello_fax.rb', line 35

def fax_lines
  self.class.get("/Accounts/#{@guid}/FaxLines")
end

#find_fax_numbers(state_code) ⇒ Object



39
40
41
# File 'lib/hello_fax.rb', line 39

def find_fax_numbers(state_code)
  self.class.get('/AreaCodes', :query => { :StateCode => state_code })
end

#send_fax(to, file) ⇒ Object



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

def send_fax(to, file)
  self.class.post("/Accounts/#{@guid}/Transmissions", :query => { :To => to, :file => file })
end

#transmissionsObject



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

def transmissions
  self.class.get("/Accounts/#{@guid}/Transmissions")
end

#update_account_details(options) ⇒ Object



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

def (options)
  self.class.put("/Accounts/#{@guid}", :query => options)
end