Sha256: 158b8bf91f6317e617ea68fa13aa34d4544904f45b03dfcd6dc7fa9e4a895604

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

require "active_support"

module Voltron
  class Config

    include ::ActiveSupport::Callbacks

    set_callback :generate_voltron_config, :add_flash_config

    def flash
      @flash ||= Flash.new
    end

    def add_flash_config
      Voltron.config.merge(flash: flash.to_h)
    end

    class Flash

      attr_accessor :header, :group

      def initialize
        @header ||= "X-Flash"
        @group ||= true
      end

      def to_h
        { header: header, group: group }
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voltron-flash-0.1.3 lib/voltron/config/flash.rb
voltron-flash-0.1.1 lib/voltron/config/flash.rb
voltron-flash-0.1.4 lib/voltron/config/flash.rb
voltron-flash-0.1.2 lib/voltron/config/flash.rb
voltron-flash-0.1.5 lib/voltron/config/flash.rb