class MonetaryValue

Included Modules

Defined in:

classes/monetary_value.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(value_in_cents : Int64, positive : Bool = true) #

[View source]

Class Method Detail

def self.from_float(float_value : Float64) #

[View source]
def self.zero #

[View source]

Instance Method Detail

def +(other : MonetaryValue) #

[View source]
def <=>(other : MonetaryValue) #

[View source]
def negative #

[View source]
def positive : Bool #

[View source]
def positive=(positive : Bool) #

[View source]
def signed_cents #

[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def value_in_cents : Int64 #

[View source]
def value_in_cents=(value_in_cents : Int64) #

[View source]