Class: MathViz::Input

Inherits:
Constant show all
Defined in:
lib/mathviz.rb

Overview

A simple number.

Derives most of it’s behavior from MathViz::Constant, but also identifies the number as variable, which affects nodes display style, so that opportunities for constant-folding can be idenified.

Instance Attribute Summary

Attributes inherited from Term

#name

Instance Method Summary collapse

Methods inherited from Constant

#finite?, #initialize, #long, #to_f, #units

Methods inherited from Term

binop, #color, #data, #label, list_terms, name_terms!, #style, #to_dot, #to_i, #to_s, unop

Methods included from Measured

#per, #unit, #units, #with_units

Methods included from Units::Class

#included, #new_units

Constructor Details

This class inherits a constructor from MathViz::Constant

Instance Method Details

#constant?Boolean

false

Returns:

  • (Boolean)


470
471
472
# File 'lib/mathviz.rb', line 470

def constant?
  false
end

#shapeObject

Graphiviz node shape



465
466
467
# File 'lib/mathviz.rb', line 465

def shape
  :ellipse
end