Class: PointThinner
- Inherits:
-
Object
- Object
- PointThinner
- Defined in:
- lib/ruby-doom.rb
Instance Method Summary collapse
-
#initialize(p, factor) ⇒ PointThinner
constructor
A new instance of PointThinner.
- #thin ⇒ Object
Constructor Details
#initialize(p, factor) ⇒ PointThinner
Returns a new instance of PointThinner.
64 65 66 67 |
# File 'lib/ruby-doom.rb', line 64 def initialize(p, factor) @points = p @factor = factor end |
Instance Method Details
#thin ⇒ Object
68 69 70 71 72 |
# File 'lib/ruby-doom.rb', line 68 def thin newline = [@points[0]] 1.upto(@points.size-1) {|x| newline << @points[x] if x % @factor == 0 } newline end |