Sha256: c5024d37a163f2f4bed020601fae3c77b4188eb6fba63df91b82bff4b7dfd4a5

Contents?: true

Size: 442 Bytes

Versions: 4

Compression:

Stored size: 442 Bytes

Contents

module Aldous
  module Respondable
    module Shared
      class Flash
        attr_reader :result, :flash_container

        def initialize(result, flash_container)
          @result = result
          @flash_container = flash_container
        end

        def set_error
          flash_container[:error] = error if error
        end

        private

        def error
          result.errors.first
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aldous-1.1.3 lib/aldous/respondable/shared/flash.rb
aldous-1.1.2 lib/aldous/respondable/shared/flash.rb
aldous-1.0.1 lib/aldous/respondable/shared/flash.rb
aldous-1.0.0 lib/aldous/respondable/shared/flash.rb