Class: RubimCode::LoopCounter
- Inherits:
-
UserVariable
- Object
- UserVariable
- RubimCode::LoopCounter
- Defined in:
- lib/rubimc.rb
Overview
ToDo: в Ruby присваивание значений индексной переменной не должно влиять на выполнение цикла например следующий цикл будет выполнен ровно 10 раз for var in 1..10; var = var+2; end
Instance Attribute Summary
Attributes inherited from UserVariable
Instance Method Summary collapse
-
#initialize ⇒ LoopCounter
constructor
A new instance of LoopCounter.
- #to_s ⇒ Object
Methods inherited from UserVariable
#!=, #!@, #%, #&, #*, #**, #+, #+@, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #^, #c_assign=, #common_operator, #times, #to_bool, #to_i, #to_rubim, #|, #~@
Constructor Details
#initialize ⇒ LoopCounter
Returns a new instance of LoopCounter.
141 142 143 144 145 |
# File 'lib/rubimc.rb', line 141 def initialize name = "i" + RubimCode.level.to_s # ToDo - вместо "i" - __rubim__i super(name) end |
Instance Method Details
#to_s ⇒ Object
147 148 149 |
# File 'lib/rubimc.rb', line 147 def to_s self.name end |