Module: Notisend

Defined in:
lib/notisend.rb,
lib/notisend/list.rb,
lib/notisend/client.rb,
lib/notisend/message.rb,
lib/notisend/version.rb,
lib/notisend/response.rb,
lib/notisend/parameter.rb,
lib/notisend/recipient.rb,
lib/notisend/collection.rb,
lib/notisend/blank_query.rb,
lib/notisend/recipients_import.rb

Overview

Base namespace

Defined Under Namespace

Modules: BlankQuery Classes: Client, Collection, List, Message, Parameter, Recipient, RecipientsImport, Response

Constant Summary collapse

VERSION =
'0.0.1'.freeze
Error =
Class.new(StandardError)

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_tokenObject

Returns the value of attribute api_token


22
23
24
# File 'lib/notisend.rb', line 22

def api_token
  @api_token
end

Class Method Details

.clientObject


28
29
30
31
32
33
34
35
36
# File 'lib/notisend.rb', line 28

def client
  @client ||= begin
                token = ENV['NOTISEND_API_TOKEN'] || api_token

                raise Error, 'Notisend api token is blank' if token.blank?

                Client.new(token)
              end
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Notisend)

    the object that the method was called on


24
25
26
# File 'lib/notisend.rb', line 24

def configure
  yield(self) if block_given?
end