Class: MasterCard::API::SpendingPulse::ResourceConfig
- Inherits:
-
Object
- Object
- MasterCard::API::SpendingPulse::ResourceConfig
- Includes:
- Core
- Defined in:
- lib/mastercard/api/spendingpulse/resourceconfig.rb
Constant Summary collapse
- @@instance =
ResourceConfig.new
Class Method Summary collapse
Instance Method Summary collapse
- #getContext ⇒ Object
- #getHost ⇒ Object
- #getName ⇒ Object
- #getVersion ⇒ Object
-
#initialize ⇒ ResourceConfig
constructor
A new instance of ResourceConfig.
- #setCustomEnvironment(host, context) ⇒ Object
- #setEnvironment(environmet) ⇒ Object
Constructor Details
#initialize ⇒ ResourceConfig
Returns a new instance of ResourceConfig.
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 39 def initialize @name = "spending-pulse" @override = nil @host = nil @context = nil @version = "1.0.4" Config.registerResourceConfig(self) currentEnvironment = Config.getEnvironment() self.setEnvironment(currentEnvironment) end |
Class Method Details
.instance ⇒ Object
53 54 55 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 53 def self.instance return @@instance end |
Instance Method Details
#getContext ⇒ Object
71 72 73 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 71 def getContext return @context end |
#getHost ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 63 def getHost unless @override.nil? || @override == 0 return @override else return @host end end |
#getName ⇒ Object
58 59 60 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 58 def getName return @name end |
#getVersion ⇒ Object
75 76 77 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 75 def getVersion return @version end |
#setCustomEnvironment(host, context) ⇒ Object
87 88 89 90 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 87 def setCustomEnvironment(host,context) @host = host @context = context end |
#setEnvironment(environmet) ⇒ Object
79 80 81 82 83 84 85 |
# File 'lib/mastercard/api/spendingpulse/resourceconfig.rb', line 79 def setEnvironment(environmet) if Environment::MAPPING.key?(environmet) tuple = Environment::MAPPING[environmet] @host = tuple[0] @context = tuple[1] end end |