lib/catlogic/figure.rb in catlogic-0.0.2 vs lib/catlogic/figure.rb in catlogic-0.0.3

- old
+ new

@@ -1,45 +1,48 @@ -class Figure - attr_reader :label +module Catlogic + class Figure + attr_reader :label - def initialize(figure) - @label = figure - end + def initialize(figure) + @label = figure + end + def to_figure + self + end + def major_subject + if @label == 1 || @label == 3 + subject = Term.new('M') - - def major_subject - if @label == 1 || @label == 3 - subject = Term.new('M') - - elsif @label == 2 || @label == 4 - subject = Term.new('P') + elsif @label == 2 || @label == 4 + subject = Term.new('P') + end + return subject end - return subject - end - def major_predicate - if @label == 1 || @label == 3 - predicate = Term.new("P") - elsif @label == 2 || @label == 4 - predicate = Term.new("M") + def major_predicate + if @label == 1 || @label == 3 + predicate = Term.new("P") + elsif @label == 2 || @label == 4 + predicate = Term.new("M") + end + return predicate end - return predicate - end - def minor_subject - if @label == 1 || @label == 2 - subject = Term.new("S") + def minor_subject + if @label == 1 || @label == 2 + subject = Term.new("S") - elsif @label == 3 || @label == 4 - subject = Term.new("M") + elsif @label == 3 || @label == 4 + subject = Term.new("M") + end + return subject end - return subject - end - def minor_predicate - if @label == 1 || @label == 2 - predicate = Term.new("M") - elsif @label == 3 || @label == 4 - predicate = Term.new("S") + def minor_predicate + if @label == 1 || @label == 2 + predicate = Term.new("M") + elsif @label == 3 || @label == 4 + predicate = Term.new("S") + end + return predicate end - return predicate end end \ No newline at end of file