Class: Unity::Quantity
- Inherits:
-
Object
- Object
- Unity::Quantity
- Includes:
- Arithmetic, Conversion, Dimension::Vector
- Defined in:
- lib/unity/quantity.rb
Instance Attribute Summary collapse
-
#cached_expression ⇒ Object
Returns the value of attribute cached_expression.
-
#denominator ⇒ Object
Returns the value of attribute denominator.
-
#name ⇒ Object
Returns the value of attribute name.
-
#numerator ⇒ Object
Returns the value of attribute numerator.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Quantity
constructor
A new instance of Quantity.
Methods included from Arithmetic
Methods included from Conversion
Methods included from Fraction
#expanded_denominator, #expanded_numerator, #expression, #expression=, #inverse, #reduce, #unit
Methods included from Comparison
#==, #compatible!, #compatible?
Methods included from Dimension::Integer
#dimension_int, #property, #property_name
Methods included from Dimension::Vector
Constructor Details
#initialize(attributes = {}) ⇒ Quantity
Returns a new instance of Quantity.
9 10 11 12 13 14 |
# File 'lib/unity/quantity.rb', line 9 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end super end |
Instance Attribute Details
#cached_expression ⇒ Object
Returns the value of attribute cached_expression.
16 17 18 |
# File 'lib/unity/quantity.rb', line 16 def cached_expression @cached_expression end |
#denominator ⇒ Object
Returns the value of attribute denominator.
16 17 18 |
# File 'lib/unity/quantity.rb', line 16 def denominator @denominator end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/unity/quantity.rb', line 16 def name @name end |
#numerator ⇒ Object
Returns the value of attribute numerator.
16 17 18 |
# File 'lib/unity/quantity.rb', line 16 def numerator @numerator end |
#value ⇒ Object
Returns the value of attribute value.
16 17 18 |
# File 'lib/unity/quantity.rb', line 16 def value @value end |