Module: Mumuki::Domain::Status::Discussion::Opened

Extended by:
Mumuki::Domain::Status::Discussion
Defined in:
lib/mumuki/domain/status/discussion/opened.rb

Constant Summary

Constants included from Mumuki::Domain::Status::Discussion

STATUSES

Class Method Summary collapse

Methods included from Mumuki::Domain::Status::Discussion

reachable_statuses_for, reachable_statuses_for_initiator, reachable_statuses_for_moderator, should_be_shown?

Methods included from Mumuki::Domain::Status

#==, #as_json, #dup, #to_i, #to_s, #to_sym

Class Method Details

.iconizeObject



24
25
26
# File 'lib/mumuki/domain/status/discussion/opened.rb', line 24

def self.iconize
  {class: :warning, type: 'question-circle'}
end

.opened?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/mumuki/domain/status/discussion/opened.rb', line 4

def self.opened?
  true
end

.reachable_statuses_for_initiator(discussion) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/mumuki/domain/status/discussion/opened.rb', line 8

def self.reachable_statuses_for_initiator(discussion)
  if discussion.has_responses?
    [Mumuki::Domain::Status::Discussion::PendingReview]
  else
    [Mumuki::Domain::Status::Discussion::Closed]
  end
end

.reachable_statuses_for_moderator(discussion) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/mumuki/domain/status/discussion/opened.rb', line 16

def self.reachable_statuses_for_moderator(discussion)
  if discussion.has_responses?
    [Mumuki::Domain::Status::Discussion::Closed, Mumuki::Domain::Status::Discussion::Solved]
  else
    [Mumuki::Domain::Status::Discussion::Closed]
  end
end

.requires_attention_for?(discussion) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/mumuki/domain/status/discussion/opened.rb', line 32

def self.requires_attention_for?(discussion)
  discussion.requires_moderator_response?
end

.should_be_shown?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/mumuki/domain/status/discussion/opened.rb', line 28

def self.should_be_shown?(*)
  true
end