Class: Figure

Inherits:
Object
  • Object
show all
Defined in:
lib/catlogic/figure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelObject (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_predicateObject



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_subjectObject



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_predicateObject



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_subjectObject



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