Class: Michael::Models::Review

Inherits:
Object
  • Object
show all
Defined in:
lib/michael/models/review.rb

Instance Method Summary collapse

Constructor Details

#initialize(review) ⇒ Review

Returns a new instance of Review.



8
9
10
# File 'lib/michael/models/review.rb', line 8

def initialize(review)
  @review = review
end

Instance Method Details

#approved?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/michael/models/review.rb', line 24

def approved?
  state == :APPROVED
end

#authorObject



12
13
14
# File 'lib/michael/models/review.rb', line 12

def author
  review[:user][:login]
end

#changes_requested?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/michael/models/review.rb', line 28

def changes_requested?
  state == :CHANGES_REQUESTED
end

#commented?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/michael/models/review.rb', line 32

def commented?
  state == :COMMENTED
end

#dotObject



36
37
38
# File 'lib/michael/models/review.rb', line 36

def dot
  dot_status[state]
end

#stateObject



20
21
22
# File 'lib/michael/models/review.rb', line 20

def state
  review[:state].to_sym
end

#submitted_atObject



16
17
18
# File 'lib/michael/models/review.rb', line 16

def 
  review[:submitted_at]
end