In Files

Parent

Methods

Fractals::Fractal

The Fractal base class.

Attributes

c[RW]

The complex number seed.

args[RW]

A Hash of arguments used in the fractal’s expression.

expression[RW]

The fractal’s expression as a block.

Public Class Methods

new(c, args, &expression) click to toggle source

Sets the default property values.

# File lib/fractals.rb, line 46
    def initialize(c, args, &expression)
      @c, @args, @expression = c, args, expression
      super()
    end

Public Instance Methods

iterate(n) click to toggle source

Iterates the fractal’s expression n times yielding the iteration number and result.

# File lib/fractals.rb, line 53
    def iterate(n)
      @args[:z] = @args[:c]
      n.times do |i|
        @expression.call(@args)
        yield i, @args[:z]
      end
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.