Class: WinewooUser::News::CreateNewsFeed

Inherits:
BaseUseCase
  • Object
show all
Defined in:
lib/winewoo_core/use_cases/winewoo_user/news/create_news_feed.rb

Instance Method Summary collapse

Constructor Details

#initialize(log_params = nil) ⇒ CreateNewsFeed

Returns a new instance of CreateNewsFeed.



4
5
6
# File 'lib/winewoo_core/use_cases/winewoo_user/news/create_news_feed.rb', line 4

def initialize(log_params=nil)
  super(WinewooCore.feed_repo.new, log_params)
end

Instance Method Details

#call(log) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/winewoo_core/use_cases/winewoo_user/news/create_news_feed.rb', line 9

def call(log)
  if (log.action == "wine_from_scan") ||
      (log.action == "wine_from_pending_scan") ||
      (log.action == "wine_from_camfind") ||
      (log.action == "comment_wine")
    self.repo.create(log)
  end
end