Class: HelloFax::API
Instance Attribute Summary collapse
-
#guid ⇒ Object
Returns the value of attribute guid.
Instance Method Summary collapse
- #account_details ⇒ Object
- #fax_lines ⇒ Object
- #find_fax_numbers(state_code) ⇒ Object
-
#initialize(username, password, guid) ⇒ API
constructor
A new instance of API.
- #send_fax(to, file) ⇒ Object
- #transmissions ⇒ Object
- #update_account_details(options) ⇒ Object
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
#guid ⇒ Object
Returns the value of attribute guid.
12 13 14 |
# File 'lib/hello_fax.rb', line 12 def guid @guid end |
Instance Method Details
#account_details ⇒ Object
23 24 25 |
# File 'lib/hello_fax.rb', line 23 def account_details self.class.get("/Accounts/#{@guid}") end |
#fax_lines ⇒ Object
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 |
#transmissions ⇒ Object
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 update_account_details() self.class.put("/Accounts/#{@guid}", :query => ) end |