firstmiler_sms_oauth 0.0.9 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module FirstmilerSmsOauth
2
2
  class << self
3
- attr_accessor :exotel_sid, :exotel_token, :sms_template, :code, :from_number
3
+ attr_accessor :exotel_sid, :exotel_token, :sms_template, :code, :from_number, :send_attr_name
4
4
 
5
5
  def configure
6
6
  yield self
@@ -6,15 +6,21 @@ module FirstmilerSmsOauth
6
6
  end
7
7
 
8
8
  module ClassMethods
9
- def acts_as_sms_oauth
9
+
10
+ def acts_as_sms_oauth(method_name)
11
+ set_method_name(method_name)
10
12
  send :include, InstanceMethods
11
13
  end
14
+
15
+ def set_method_name(m_name)
16
+ FirstmilerSmsOauth.send_attr_name = m_name
17
+ end
12
18
  end
13
19
 
14
20
  module InstanceMethods
15
21
  def send_otp_token
16
22
  content = sms_content
17
- FirstmilerSmsOauth::FmSms.send(self.phone_no, content)
23
+ FirstmilerSmsOauth::FmSms.send(self.send(FirstmilerSmsOauth.send_attr_name), content)
18
24
  end
19
25
 
20
26
  def delete_user_sms_oauth_tokens
@@ -1,3 +1,3 @@
1
1
  module FirstmilerSmsOauth
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firstmiler_sms_oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-10 00:00:00.000000000 Z
12
+ date: 2015-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord