Sha256: 26efc9eb98a7b99d269a14bfe68a5a9884ac796c7e7663317517ff32bdfed944

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 Bytes

Contents

module Catlogic
  class Term
    attr_reader :label

    def initialize(termname)
      @label = termname
    end

    def opposite
      opposite = Term.new("non-#{@label}")
      return opposite
    end

    def distribution_subject(quantity)
        if quantity.label == 'universal'
          @distribution = Distribution.new('distributed')
        elsif quantity.label == 'particular'
          @distribution = Distribution.new('undistributed')
        end
      return @distribution

    end

    def distribution_predicate(quality)
      if quality.label == 'affirmative'
        @distribution = Distribution.new('undistributed')
      elsif quality.label == 'negative'
        @distribution = Distribution.new('distributed')
      end
      return @distribution
    end
    def to_term
      self
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
catlogic-1.1.0 lib/catlogic/term.rb
catlogic-1.0.0 lib/catlogic/term.rb
catlogic-0.0.3 lib/catlogic/term.rb