Class: Catlogic::Mood

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(majortype, minortype, conclusiontype) ⇒ Mood

takes three propositionType objects



6
7
8
9
10
# File 'lib/catlogic/mood.rb', line 6

def initialize(majortype, minortype, conclusiontype)
  @majortype = majortype.to_proposition_type
  @minortype = minortype.to_proposition_type
  @conclusiontype = conclusiontype.to_proposition_type
end

Instance Attribute Details

#conclusiontypeObject (readonly)

Returns the value of attribute conclusiontype.



3
4
5
# File 'lib/catlogic/mood.rb', line 3

def conclusiontype
  @conclusiontype
end

#majortypeObject (readonly)

Returns the value of attribute majortype.



3
4
5
# File 'lib/catlogic/mood.rb', line 3

def majortype
  @majortype
end

#minortypeObject (readonly)

Returns the value of attribute minortype.



3
4
5
# File 'lib/catlogic/mood.rb', line 3

def minortype
  @minortype
end

Instance Method Details

#labelObject



16
17
18
# File 'lib/catlogic/mood.rb', line 16

def label
  "#{@majortype.label}#{@minortype.label}#{@conclusiontype.label}"
end

#to_moodObject



12
13
14
# File 'lib/catlogic/mood.rb', line 12

def to_mood
  self
end

#to_sObject



20
21
22
# File 'lib/catlogic/mood.rb', line 20

def to_s
  self.label
end