Sha256: 9458b5281658a98625be294156fcf1a5e9d1540d8bf0c154c679d01c42a58a4b
Contents?: true
Size: 801 Bytes
Versions: 5
Compression:
Stored size: 801 Bytes
Contents
module Danica class Variable include ActiveModel::Model include BaseOperations include Common attr_accessor :value, :name, :latex, :gnu default_value :priority, 10 default_value :is_grouped?, false def to_f value.nil? ? raise(Exception::NotDefined) : value.to_f end def ==(other) return false unless other.class == Variable return other.value == value && other.name == name && other.latex == latex && other.gnu == gnu end def to_tex return value.to_tex if value (latex || name).to_s end def to_gnu return value.to_gnu if value (gnu || name).to_s end def value=(value) @value = value.is_a?(Numeric) ? Number.new(value) : value end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
danica-2.2.1 | lib/danica/variable.rb |
danica-2.2.0 | lib/danica/variable.rb |
danica-2.1.1 | lib/danica/variable.rb |
danica-2.1.0 | lib/danica/variable.rb |
danica-2.0.6 | lib/danica/variable.rb |