Class: CloudRailSi::ServiceCode::Floor
- Inherits:
-
Object
- Object
- CloudRailSi::ServiceCode::Floor
- Defined in:
- lib/cloudrail_si/servicecode/commands/math/Floor.rb
Instance Method Summary collapse
Instance Method Details
#execute(environment, parameters) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/cloudrail_si/servicecode/commands/math/Floor.rb', line 10 def execute(environment, parameters) Helper.assert(parameters.length == 2 && Helper.is_var_address(parameters[0])) result_var = parameters[0] input = Helper.resolve(environment, parameters[1]) Helper.assert(Helper.is_number(input)) res = round_down(input).to_i environment.set_variable(result_var, res) end |
#get_identifier ⇒ Object
6 7 8 |
# File 'lib/cloudrail_si/servicecode/commands/math/Floor.rb', line 6 def get_identifier 'math.floor' end |