Class: MasterCard::API::PersonalizedLoyaltyOffers::ResourceConfig

Inherits:
Object
  • Object
show all
Includes:
Core
Defined in:
lib/mastercard/api/personalizedloyaltyoffers/resourceconfig.rb

Constant Summary collapse

@@instance =
ResourceConfig.new

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResourceConfig

Returns a new instance of ResourceConfig.



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/mastercard/api/personalizedloyaltyoffers/resourceconfig.rb', line 39

def initialize
	@name = "personalized-loyalty-offers"
	@override = nil
	@host = nil
	@context = nil
	@version = "1.0.3"

	Config.registerResourceConfig(self)
	currentEnvironment = Config.getEnvironment()
	self.setEnvironment(currentEnvironment)

end

Class Method Details

.instanceObject



53
54
55
# File 'lib/mastercard/api/personalizedloyaltyoffers/resourceconfig.rb', line 53

def self.instance
	return @@instance
end

Instance Method Details

#getContextObject



71
72
73
# File 'lib/mastercard/api/personalizedloyaltyoffers/resourceconfig.rb', line 71

def getContext
	return @context
end

#getHostObject



63
64
65
66
67
68
69
# File 'lib/mastercard/api/personalizedloyaltyoffers/resourceconfig.rb', line 63

def getHost
	unless @override.nil? || @override == 0
		return @override
	else
		return @host
	end
end

#getNameObject



58
59
60
# File 'lib/mastercard/api/personalizedloyaltyoffers/resourceconfig.rb', line 58

def getName
	return @name
end

#getVersionObject



75
76
77
# File 'lib/mastercard/api/personalizedloyaltyoffers/resourceconfig.rb', line 75

def getVersion
	return @version
end

#setCustomEnvironment(host, context) ⇒ Object



87
88
89
90
# File 'lib/mastercard/api/personalizedloyaltyoffers/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/personalizedloyaltyoffers/resourceconfig.rb', line 79

def setEnvironment(environmet)
	if Environment::MAPPING.key?(environmet)
		tuple = Environment::MAPPING[environmet]
		@host = tuple[0]
		@context = tuple[1]
	end
end