Class: TaaS::Contract

Inherits:
Object
  • Object
show all
Defined in:
lib/helper/contract.rb

Instance Method Summary collapse

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

Returns:

  • (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