Sha256: 1808763aafac4698bc95395d3bc622efd21102b510be62c1b1a757152e7b46e4

Contents?: true

Size: 666 Bytes

Versions: 23

Compression:

Stored size: 666 Bytes

Contents

module Castronaut

  class TicketResult
    InvalidMessageCategories = %w{warn error fatal invalid} 

    attr_reader :ticket, :message, :message_category
    delegate :username, :proxies, :to => :ticket
        
    def initialize(ticket, message=nil, message_category=nil)
      @ticket = ticket
      @message = message
      @message_category = message_category
      Castronaut.logger.info("#{self.class} - #{@message_category} #{@message} for #{@ticket}") if @message && @ticket
    end

    def valid?
      !invalid?
    end
    
    def invalid?
      InvalidMessageCategories.any?{ |cat| message_category.to_s.downcase.include?(cat) }
    end

  end

end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
masover-castronaut-0.4.4.4 lib/castronaut/ticket_result.rb
p8-castronaut-0.6.1.1 lib/castronaut/ticket_result.rb
relevance-castronaut-0.2.0 lib/castronaut/ticket_result.rb
relevance-castronaut-0.2.5 lib/castronaut/ticket_result.rb
relevance-castronaut-0.3.0 lib/castronaut/ticket_result.rb
relevance-castronaut-0.3.5 lib/castronaut/ticket_result.rb
relevance-castronaut-0.3.6 lib/castronaut/ticket_result.rb
relevance-castronaut-0.4.1 lib/castronaut/ticket_result.rb
relevance-castronaut-0.4.2 lib/castronaut/ticket_result.rb
relevance-castronaut-0.4.3 lib/castronaut/ticket_result.rb
relevance-castronaut-0.4.4 lib/castronaut/ticket_result.rb
relevance-castronaut-0.4.5 lib/castronaut/ticket_result.rb
relevance-castronaut-0.4.6 lib/castronaut/ticket_result.rb
relevance-castronaut-0.5.0 lib/castronaut/ticket_result.rb
relevance-castronaut-0.5.1 lib/castronaut/ticket_result.rb
relevance-castronaut-0.5.2 lib/castronaut/ticket_result.rb
relevance-castronaut-0.5.3 lib/castronaut/ticket_result.rb
relevance-castronaut-0.5.4 lib/castronaut/ticket_result.rb
relevance-castronaut-0.6.0 lib/castronaut/ticket_result.rb
relevance-castronaut-0.6.1 lib/castronaut/ticket_result.rb