Sha256: 6f289dc2329325f2c83c78773c45f4228477daa4cec30c4b1f5155d87317189a

Contents?: true

Size: 605 Bytes

Versions: 5

Compression:

Stored size: 605 Bytes

Contents

module Danica
  class Constant
    include BaseOperations
    include Common

    attr_reader :value, :latex, :gnu

    default_value :priority, 10
    default_value :valued?, true
    default_value :is_grouped?, false

    def initialize(value, latex, gnu)
      @value = value
      @latex = latex
      @gnu = gnu
    end

    def to_f
      value.to_f
    end

    def ==(other)
      return false unless other.class == self.class
      gnu == other.gnu && latex == other.latex && value == other.value
    end

    def to_tex
      latex.to_s
    end

    def to_gnu
      gnu.to_s
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
danica-2.2.1 lib/danica/constant.rb
danica-2.2.0 lib/danica/constant.rb
danica-2.1.1 lib/danica/constant.rb
danica-2.1.0 lib/danica/constant.rb
danica-2.0.6 lib/danica/constant.rb