Class: Figure
- Inherits:
-
Object
- Object
- Figure
- Defined in:
- lib/catlogic/figure.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(figure) ⇒ Figure
constructor
A new instance of Figure.
- #major_predicate ⇒ Object
- #major_subject ⇒ Object
- #minor_predicate ⇒ Object
- #minor_subject ⇒ Object
Constructor Details
#initialize(figure) ⇒ Figure
Returns a new instance of Figure.
4 5 6 |
# File 'lib/catlogic/figure.rb', line 4 def initialize(figure) @label = figure end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
2 3 4 |
# File 'lib/catlogic/figure.rb', line 2 def label @label end |
Instance Method Details
#major_predicate ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/catlogic/figure.rb', line 19 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 |
#major_subject ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/catlogic/figure.rb', line 9 def major_subject if @label == 1 || @label == 3 subject = Term.new('M') elsif @label == 2 || @label == 4 subject = Term.new('P') end return subject end |
#minor_predicate ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/catlogic/figure.rb', line 37 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 |
#minor_subject ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/catlogic/figure.rb', line 27 def minor_subject if @label == 1 || @label == 2 subject = Term.new("S") elsif @label == 3 || @label == 4 subject = Term.new("M") end return subject end |