Class: Reviewable::PerformResult

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serialization
Defined in:
lib/reviewable/perform_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reviewable, status) ⇒ PerformResult

Returns a new instance of PerformResult.



17
18
19
20
21
# File 'lib/reviewable/perform_result.rb', line 17

def initialize(reviewable, status)
  @status = status
  @reviewable = reviewable
  @remove_reviewable_ids = [reviewable.id] if success?
end

Instance Attribute Details

#created_postObject

Returns the value of attribute created_post.



7
8
9
# File 'lib/reviewable/perform_result.rb', line 7

def created_post
  @created_post
end

#created_post_topicObject (readonly)

Returns the value of attribute created_post_topic.



7
8
9
# File 'lib/reviewable/perform_result.rb', line 7

def created_post_topic
  @created_post_topic
end

#errorsObject

Returns the value of attribute errors.



8
9
10
# File 'lib/reviewable/perform_result.rb', line 8

def errors
  @errors
end

#recalculate_scoreObject

Returns the value of attribute recalculate_score.



8
9
10
# File 'lib/reviewable/perform_result.rb', line 8

def recalculate_score
  @recalculate_score
end

#remove_reviewable_idsObject

Returns the value of attribute remove_reviewable_ids.



8
9
10
# File 'lib/reviewable/perform_result.rb', line 8

def remove_reviewable_ids
  @remove_reviewable_ids
end

#reviewableObject (readonly)

Returns the value of attribute reviewable.



7
8
9
# File 'lib/reviewable/perform_result.rb', line 7

def reviewable
  @reviewable
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/reviewable/perform_result.rb', line 7

def status
  @status
end

#transition_toObject

Returns the value of attribute transition_to.



8
9
10
# File 'lib/reviewable/perform_result.rb', line 8

def transition_to
  @transition_to
end

#update_flag_statsObject

Returns the value of attribute update_flag_stats.



8
9
10
# File 'lib/reviewable/perform_result.rb', line 8

def update_flag_stats
  @update_flag_stats
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/reviewable/perform_result.rb', line 28

def success?
  @status == :success
end