module MyMoip
Constants
- VERSION
Attributes
default_referer_url[RW]
environment[RW]
logger[RW]
production_key[RW]
production_token[RW]
sandbox_key[RW]
sandbox_token[RW]
Public Class Methods
api_url()
click to toggle source
# File lib/mymoip.rb, line 13 def api_url if environment == "sandbox" "https://desenvolvedor.moip.com.br/sandbox" else "https://www.moip.com.br" end end
ensure_key_and_token_set!()
click to toggle source
# File lib/mymoip.rb, line 39 def ensure_key_and_token_set! if MyMoip.key.blank? raise StandardError, "Invalid MyMoip.#{environment}_key set." elsif MyMoip.token.blank? raise StandardError, "Invalid MyMoip.#{environment}_token set." end end
key()
click to toggle source
# File lib/mymoip.rb, line 31 def key send(:"#{environment}_key") end
key=(value)
click to toggle source
# File lib/mymoip.rb, line 21 def key=(value) warn "[DEPRECATION] `key=` is deprecated. Please use `sandbox_key` or `production_key` instead." @production_key = @sandbox_key = value end
token()
click to toggle source
# File lib/mymoip.rb, line 35 def token send(:"#{environment}_token") end
token=(value)
click to toggle source
# File lib/mymoip.rb, line 26 def token=(value) warn "[DEPRECATION] `token=` is deprecated. Please use `sandbox_token` or `production_token` instead." @production_token = @sandbox_token = value end