Class: Workarea::Storefront::ContentBlocks::HeroViewModel

Inherits:
Workarea::Storefront::ContentBlockViewModel show all
Defined in:
app/view_models/workarea/storefront/content_blocks/hero_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

#button_position_classObject



17
18
19
# File 'app/view_models/workarea/storefront/content_blocks/hero_view_model.rb', line 17

def button_position_class
  "hero-content-block__button--#{data[:position].optionize.dasherize}"
end

#button_style_classObject



9
10
11
12
13
14
15
# File 'app/view_models/workarea/storefront/content_blocks/hero_view_model.rb', line 9

def button_style_class
  classes = ['button']
  classes << 'button--large' if data[:style] == 'Large'
  classes << 'button--small' if data[:style] == 'Small'

  classes.join(' ')
end

#imageObject



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

def image
  find_asset(data[:asset])
end