Class: AwardEmojisFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/award_emojis_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(awardable, params = {}) ⇒ AwardEmojisFinder

Returns a new instance of AwardEmojisFinder.


6
7
8
9
10
11
# File 'app/finders/award_emojis_finder.rb', line 6

def initialize(awardable, params = {})
  @awardable = awardable
  @params = params

  validate_params
end

Instance Attribute Details

#awardableObject (readonly)

Returns the value of attribute awardable


4
5
6
# File 'app/finders/award_emojis_finder.rb', line 4

def awardable
  @awardable
end

#paramsObject (readonly)

Returns the value of attribute params


4
5
6
# File 'app/finders/award_emojis_finder.rb', line 4

def params
  @params
end

Instance Method Details

#executeObject


13
14
15
16
17
18
# File 'app/finders/award_emojis_finder.rb', line 13

def execute
  awards = awardable.award_emoji
  awards = by_name(awards)
  awards = by_awarded_by(awards)
  awards
end