Class: TaaS::Contract
- Inherits:
-
Object
- Object
- TaaS::Contract
- Defined in:
- lib/helper/contract.rb
Instance Method Summary collapse
- #command(params) ⇒ Object
- #has_property?(key) ⇒ Boolean
-
#initialize(hash) ⇒ Contract
constructor
A new instance of Contract.
- #value_of(key) ⇒ Object
Constructor Details
#initialize(hash) ⇒ Contract
Returns a new instance of Contract.
4 5 6 |
# File 'lib/helper/contract.rb', line 4 def initialize(hash) @hash = hash end |
Instance Method Details
#command(params) ⇒ Object
16 17 18 19 20 |
# File 'lib/helper/contract.rb', line 16 def command(params) command = @hash["command"] parameter_string = ParameterFactory.generate_parameter_string(@hash["input_param_format"],params) command.scan(/<taas_params>/).empty? ? command+parameter_string : command.gsub("<taas_params>",parameter_string) end |
#has_property?(key) ⇒ Boolean
12 13 14 |
# File 'lib/helper/contract.rb', line 12 def has_property?(key) @hash.has_key?(key) end |
#value_of(key) ⇒ Object
8 9 10 |
# File 'lib/helper/contract.rb', line 8 def value_of(key) @hash[key] end |