Module: FrontKit::Base

Extended by:
ActiveSupport::Concern
Defined in:
lib/frontkit-rails/base.rb

Instance Method Summary collapse

Instance Method Details

#frontend_stateObject

instance methods



19
20
21
22
23
24
25
# File 'lib/frontkit-rails/base.rb', line 19

def frontend_state
  @_frontend_state ||= FrontKit::State.new(
    production: Rails.env.production?,
    alert: alert,
    notice: notice
  )
end

#merge_frontend_state(hash) ⇒ Object



31
32
33
# File 'lib/frontkit-rails/base.rb', line 31

def merge_frontend_state(hash)
  frontend_state.deep_merge!(hash)
end

#meta_tags_containerObject



35
36
37
# File 'lib/frontkit-rails/base.rb', line 35

def meta_tags_container
  @_meta_tags_container ||= FrontKit::MetaContainer.new
end

#push_frontend_state(key, value) ⇒ Object



27
28
29
# File 'lib/frontkit-rails/base.rb', line 27

def push_frontend_state(key, value)
  frontend_state[key] = value
end

#push_meta_tag(hash) ⇒ Object



39
40
41
# File 'lib/frontkit-rails/base.rb', line 39

def push_meta_tag(hash)
  meta_tags_container.push(hash)
end