Sha256: db6617e4b9fdac26996da494aa2ec6eb52ed27e50dbb3cc45f2cc96db9789ac7
Contents?: true
Size: 742 Bytes
Versions: 6
Compression:
Stored size: 742 Bytes
Contents
module <%= config[:camel_cased_app_name] %> class Page attr_reader :options def initialize(options = {}) @options = options end def view_locals { csrf_token: csrf_token, csrf_tag: csrf_tag, } end def csrf_token self[:csrf_token].() end def csrf_metatag self[:csrf_metatag].() end def csrf_tag self[:csrf_tag].() end def flash self[:flash] end def flash? %w(notice alert).any? { |type| flash[type] } end def with_flash(flash) with(flash: flash) end def with(new_options) self.class.new(options.merge(new_options)) end def [](name) options.fetch(name) end end end
Version data entries
6 entries across 6 versions & 1 rubygems