class Units::Scale
- Units::Scale
- Reference
- Object
Included Modules
- Comparable(Units::Scale)
- Units::Compatible
Direct Known Subclasses
Defined in:
units/scale.crConstructors
- .new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : String, search : Mode = Mode::PrimaryCode)
- .new(value : BigDecimal, unit : Unit = Unit.new)
- .new(value : BigDecimal, unit : String, mode : Mode = Mode::PrimaryCode)
- .new(value : Number | String, unit : Unit = Unit.new)
- .new(value : Number | String, unit : String, mode : Mode = Mode::PrimaryCode)
-
.new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : Unit = Unit.new)
return a ScaleFunction version of scale
Instance Method Summary
- #atoms(*args, **options)
- #atoms(*args, **options, &)
- #depth : Int32
-
#inspect(io : IO) : Nil
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
- #magnitude(scalar = scalar())
- #mode : Mode
- #root_terms : Array(Term)
- #scalar(magnitude = value)
- #special?(*args, **options)
- #special?(*args, **options, &)
- #terms(*args, **options)
- #terms(*args, **options, &)
- #to_s(io, mode : Mode = @mode) : Nil
- #unit : Unit
- #value : BigDecimal
Instance methods inherited from module Units::Compatible
<=>(other)
<=>,
compatible_with?(other)
compatible_with?,
composition : Multiset(String)
composition,
composition_string : String
composition_string,
dimension
dimension
Constructor Detail
def self.new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : String, search : Mode = Mode::PrimaryCode)
#
def self.new(function_code : String | ScaleFunction::FunctionSelection, value : Number | String, unit : Unit = Unit.new)
#
return a ScaleFunction version of scale
Instance Method Detail
def inspect(io : IO) : Nil
#
Description copied from class Reference
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>