Class: Workarea::Storefront::ContentBlocks::ImageGroupViewModel

Inherits:
Workarea::Storefront::ContentBlockViewModel show all
Defined in:
app/view_models/workarea/storefront/content_blocks/image_group_view_model.rb

Instance Method Summary collapse

Methods inherited from Workarea::Storefront::ContentBlockViewModel

#asset_alt_text, #assets, #find_asset, #locals, #partial, #series, wrap

Instance Method Details

#altObject



13
14
15
# File 'app/view_models/workarea/storefront/content_blocks/image_group_view_model.rb', line 13

def alt
  data[:alt]
end

#assetObject



9
10
11
# File 'app/view_models/workarea/storefront/content_blocks/image_group_view_model.rb', line 9

def asset
  find_asset(data[:image])
end


5
6
7
# File 'app/view_models/workarea/storefront/content_blocks/image_group_view_model.rb', line 5

def link
  data[:link]
end

#odd?Boolean

TODO v4 remove

Returns:

  • (Boolean)


18
19
20
# File 'app/view_models/workarea/storefront/content_blocks/image_group_view_model.rb', line 18

def odd?
  series.size.odd?
end