Class: Happenings::HappeningComponent

Inherits:
CommonComponent
  • Object
show all
Defined in:
app/components/happenings/happening_component.rb

Overview

this class render an happening component for an happenings list

Instance Method Summary collapse

Methods inherited from CommonComponent

#icon, #icon_text, #level, #level_item, #pagy, #turbo_yield

Methods included from ApplicationHelper

#fas_icon, #icon, #icon_text, #l_date, #l_long, #l_time, #notifications, #notify, #notify_status, #t_enum

Constructor Details

#initialize(happening:, turbo_frame: "happenings", url: :happening_path) ⇒ HappeningComponent

Returns a new instance of HappeningComponent.

Parameters:

  • happening (Object)

    istance of Happening

  • turbo_frame (String) (defaults to: "happenings")

    (“happenings”) id of turbo_frame generated

  • url (Simbol) (defaults to: :happening_path)

    (:happening_path) method to generate link



9
10
11
12
13
# File 'app/components/happenings/happening_component.rb', line 9

def initialize(happening:, turbo_frame: "happenings", url: :happening_path)
  @happening = happening
  @turbo_frame = turbo_frame
  @url = url
end