Sha256: e79aeeb29b8ec924a85400a9c25adec21b59c2462ee7443fc17c25c254829f2f

Contents?: true

Size: 421 Bytes

Versions: 6

Compression:

Stored size: 421 Bytes

Contents

# frozen_string_literal: true

module Mako
  class Errors
    attr_accessor :messages

    def initialize
      @messages = []
    end

    # Add an error message to the messages array
    #
    # @param [String]
    def add_error(msg)
      messages << msg
    end

    # Predicate method to see if there are any error messages
    #
    # @return [Boolean]
    def any?
      messages.count.positive?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mako_rss-0.2.5 lib/mako/errors.rb
mako_rss-0.2.3 lib/mako/errors.rb
mako_rss-0.2.2 lib/mako/errors.rb
mako_rss-0.2.1 lib/mako/errors.rb
mako_rss-0.2.0 lib/mako/errors.rb
mako_rss-0.1.0 lib/mako/errors.rb