Class: SpreeCmCommissioner::HomepageData

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree_cm_commissioner/homepage_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(menu:, homepage_background:) ⇒ HomepageData

Plain Old Ruby Object (PORO) for homepage data



6
7
8
9
# File 'app/services/spree_cm_commissioner/homepage_data.rb', line 6

def initialize(menu:, homepage_background:)
  @menu = menu
  @homepage_background = homepage_background
end

Instance Attribute Details

#homepage_backgroundObject (readonly)

Returns the value of attribute homepage_background.



3
4
5
# File 'app/services/spree_cm_commissioner/homepage_data.rb', line 3

def homepage_background
  @homepage_background
end

Returns the value of attribute menu.



3
4
5
# File 'app/services/spree_cm_commissioner/homepage_data.rb', line 3

def menu
  @menu
end

Instance Method Details

#homepage_background_idObject



19
20
21
# File 'app/services/spree_cm_commissioner/homepage_data.rb', line 19

def homepage_background_id
  homepage_background&.id
end

#idObject



11
12
13
# File 'app/services/spree_cm_commissioner/homepage_data.rb', line 11

def id
  @id ||= SecureRandom.uuid
end


15
16
17
# File 'app/services/spree_cm_commissioner/homepage_data.rb', line 15

def menu_id
  menu&.id
end