Class: Mitake::Credential

Inherits:
Object
  • Object
show all
Defined in:
lib/mitake/credential.rb

Overview

The Mitake SMS Client

Since:

  • 0.1.

Constant Summary collapse

DEFAULT_SERVER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

'https://smsapi.mitake.com.tw'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username = nil, password = nil, server = nil) ⇒ Mitake::Client

Return Mitake::Client instance

Parameters:

  • username (String) (defaults to: nil)

    the username, default is ‘MITAKE_USERNAME`

  • password (String) (defaults to: nil)

    the password, default is ‘MITAKE_PASSWORD`

  • server (String) (defaults to: nil)

    the API server url

Since:

  • 0.1.0



23
24
25
26
27
# File 'lib/mitake/credential.rb', line 23

def initialize(username = nil, password = nil, server = nil)
  @username = username || ENV['MITAKE_USERNAME']
  @password = password || ENV['MITAKE_PASSWORD']
  @server = server || ENV['MITAKE_SERVER'] || DEFAULT_SERVER
end

Instance Attribute Details

#passwordObject (readonly)

Since:

  • 0.1.0



13
14
15
# File 'lib/mitake/credential.rb', line 13

def password
  @password
end

#serverObject (readonly)

Since:

  • 0.1.0



13
14
15
# File 'lib/mitake/credential.rb', line 13

def server
  @server
end

#usernameObject (readonly)

Since:

  • 0.1.0



13
14
15
# File 'lib/mitake/credential.rb', line 13

def username
  @username
end