Sha256: e63fcaf51816436d41611097e137402e2f372cbdc93c81c1b99a37790d8612f6
Contents?: true
Size: 644 Bytes
Versions: 5
Compression:
Stored size: 644 Bytes
Contents
module <%= config[:camel_cased_app_name] %> module View class Context attr_reader :attrs def initialize(attrs = {}) @attrs = attrs 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? %i[notice alert].any? { |type| flash[type] } end def with(new_attrs) self.class.new(attrs.merge(new_attrs)) end private def [](name) attrs.fetch(name) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems