Module: Nexmo
- Extended by:
- Forwardable
- Defined in:
- lib/nexmo_rails.rb
Class Attribute Summary collapse
-
.client ⇒ Object
Returns the value of attribute client.
Class Method Summary collapse
Class Attribute Details
.client ⇒ Object
Returns the value of attribute client.
8 9 10 |
# File 'lib/nexmo_rails.rb', line 8 def client @client end |
Class Method Details
.setup(&block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nexmo_rails.rb', line 16 def setup(&block) config = OpenStruct.new config.instance_eval(&block) self.client = ::Nexmo::Client.new( api_key: config.api_key, api_secret: config.api_secret, signature_secret: config.signature_secret, application_id: config.application_id, private_key: config.private_key.present? && File.exist?(config.private_key) ? File.read(config.private_key) : config.private_key ) end |