Class: Unity::DerivedUnit
- Inherits:
-
Object
- Object
- Unity::DerivedUnit
- Includes:
- ActiveModel::Validations, Conversion, Unity::Dimension::Vector
- Defined in:
- lib/unity/lookup/derived_unit.rb
Instance Attribute Summary collapse
-
#denominator ⇒ Object
Returns the value of attribute denominator.
-
#name ⇒ Object
(also: #to_s)
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 = {}) ⇒ DerivedUnit
constructor
A new instance of DerivedUnit.
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 Unity::Dimension::Integer
#dimension_int, #property, #property_name
Methods included from Unity::Dimension::Vector
Constructor Details
#initialize(attributes = {}) ⇒ DerivedUnit
Returns a new instance of DerivedUnit.
15 16 17 18 19 20 |
# File 'lib/unity/lookup/derived_unit.rb', line 15 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end super end |
Instance Attribute Details
#denominator ⇒ Object
Returns the value of attribute denominator.
9 10 11 |
# File 'lib/unity/lookup/derived_unit.rb', line 9 def denominator @denominator end |
#name ⇒ Object Also known as: to_s
Returns the value of attribute name.
9 10 11 |
# File 'lib/unity/lookup/derived_unit.rb', line 9 def name @name end |
#numerator ⇒ Object
Returns the value of attribute numerator.
9 10 11 |
# File 'lib/unity/lookup/derived_unit.rb', line 9 def numerator @numerator end |
#value ⇒ Object
Returns the value of attribute value.
9 10 11 |
# File 'lib/unity/lookup/derived_unit.rb', line 9 def value @value end |