Class: Form
- Inherits:
-
Object
- Object
- Form
- Defined in:
- lib/catlogic/form.rb
Instance Attribute Summary collapse
-
#figure ⇒ Object
readonly
Returns the value of attribute figure.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#mood ⇒ Object
readonly
Returns the value of attribute mood.
Instance Method Summary collapse
-
#initialize(mood, figure) ⇒ Form
constructor
takes three Mood Object and Figure Object.
- #syllogism ⇒ Object
- #validity ⇒ Object
Constructor Details
#initialize(mood, figure) ⇒ Form
takes three Mood Object and Figure Object
4 5 6 7 8 |
# File 'lib/catlogic/form.rb', line 4 def initialize(mood, figure) @mood = mood @figure = figure @label = "#{@mood.label}#{@figure.label}" end |
Instance Attribute Details
#figure ⇒ Object (readonly)
Returns the value of attribute figure.
2 3 4 |
# File 'lib/catlogic/form.rb', line 2 def figure @figure end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
2 3 4 |
# File 'lib/catlogic/form.rb', line 2 def label @label end |
#mood ⇒ Object (readonly)
Returns the value of attribute mood.
2 3 4 |
# File 'lib/catlogic/form.rb', line 2 def mood @mood end |
Instance Method Details
#syllogism ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/catlogic/form.rb', line 9 def syllogism majorproposition = Proposition.new(@mood.majortype.quantity, @figure.major_subject, @mood.majortype.quality, @figure.major_predicate, true) minorproposition = Proposition.new(@mood.minortype.quantity, @figure.minor_subject, @mood.minortype.quality, @figure.minor_predicate, true) conclusion = Proposition.new(@mood.conclusiontype.quantity, Term.new("S"), @mood.conclusiontype.quality, Term.new("P"), true) syllogism = Syllogism.new(majorproposition, minorproposition, conclusion) return syllogism end |
#validity ⇒ Object
18 19 20 21 |
# File 'lib/catlogic/form.rb', line 18 def validity syllogism = self.syllogism syllogism.validity end |