Sha256: 1b853b1c091a52ad8a99fdb3763a52ecf629fec8ea66e424425f8e440cd8c6c8

Contents?: true

Size: 562 Bytes

Versions: 3

Compression:

Stored size: 562 Bytes

Contents

module Danica
  class Wrapper::Group
    include Common
    include BaseOperations
    include ActiveModel::Model

    attr_accessor :value

    default_value :priority, 10
    default_value :is_grouped?, true
    
    delegate :to_f, :valued?, to: :value

    def initialize(value)
      @value = wrap_value(value)
    end

    def to_tex
      "\\left(#{value.to_tex}\\right)"
    end

    def to_gnu
      "(#{value.to_gnu})"
    end

    def ==(other)
      return value == other unless other.is_a?(self.class)
      value == other.value
    end
  end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danica-2.4.0 lib/danica/wrapper/group.rb
danica-2.3.1 lib/danica/wrapper/group.rb
danica-2.3.0 lib/danica/wrapper/group.rb