interfax-rest 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
File without changes
File without changes
data/VERSION ADDED
File without changes
@@ -0,0 +1,7 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ require 'interfax/api'
5
+ require 'interfax/base'
6
+ require 'interfax/fax'
7
+ require 'interfax/inbound'
@@ -0,0 +1,11 @@
1
+ module Interfax
2
+ module Api
3
+ module Inbound
4
+ Index = '/inbound/faxes'
5
+ Show = '/inbound/faxes/:id'
6
+ def show id
7
+ self.Show.gsub ':id', id.to_s
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,27 @@
1
+ require 'rest_client'
2
+
3
+ module Interfax
4
+ class Base
5
+ class << self
6
+ attr_accessor :username, :password
7
+
8
+ def get url, options = {}
9
+ options[:username] = @username
10
+ options[:password] = @password
11
+ RestClient.get url, options
12
+ end
13
+
14
+ def post url, options = {}
15
+ options[:username] = @username
16
+ options[:password] = @password
17
+ RestClient.post url, options
18
+ end
19
+
20
+ def delete url, options = {}
21
+ options[:username] = @username
22
+ options[:password] = @password
23
+ RestClient.delete url, options
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ module Interfax
2
+ class Fax
3
+ attr_reader :userId, :id, :phoneNumber, :remoteCSID, :messageStatus, :pages, :messageSize, :messageType, :receiveTime, :callerID, :recordingDuration, :imageStatus, :numOfEmails, :numOfFailedEmails
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ module Interfax
2
+ class Inbound < Interfax::Base
3
+ class << self
4
+ attr_accessor :unreadOnly, :limit, :offset, :allUsers, :lastId
5
+ def initialize
6
+ @unreadOnly = false
7
+ @limit = 25
8
+ @lastId = -1
9
+ @allUsers = false
10
+ end
11
+
12
+ def index unreadOnly = @unreadOnly, limit = @limit, lastId = @lastId, allUsers = @allUsers
13
+ response = self.get Api::Inbound::Index, { :unreadOnly => unreadOnly, :limit => limit, :offset => offset, :allUsers => allUsers, :lastId => lastId }
14
+ end
15
+ end
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: interfax-rest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Peter Ragone
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rest-client
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.6.7
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - '='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.6.7
30
+ description: ''
31
+ email: pcragone@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - LICENSE
37
+ - README.markdown
38
+ - VERSION
39
+ - lib/interfax.rb
40
+ - lib/interfax/api.rb
41
+ - lib/interfax/base.rb
42
+ - lib/interfax/fax.rb
43
+ - lib/interfax/inbound.rb
44
+ homepage: http://www.github.com/pcragone/interfax
45
+ licenses: []
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 1.8.24
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: ''
68
+ test_files: []