Sha256: f6a125d1a2570f382f5241baddac73e08943d78f8c867e536feb7891e91bcc2e
Contents?: true
Size: 668 Bytes
Versions: 6
Compression:
Stored size: 668 Bytes
Contents
# auto_register: false 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
6 entries across 6 versions & 1 rubygems