Class Uttk::Status
In: lib/uttk/status.rb
Parent: UttkException

Methods

Included Modules

Abstract

Attributes

reason  [RW] 
weight  [RW] 

Public Class methods

[Source]

# File lib/uttk/status.rb, line 12
    def self.default_weight ( aSymbol )
      self.default_weight_value = Weights::Default.new(aSymbol)
    end

[Source]

# File lib/uttk/status.rb, line 20
    def self.hook_name
      (status_name.to_s.downcase + '_hook').to_sym
    end

[Source]

# File lib/uttk/status.rb, line 32
    def initialize ( anObject=nil )
      super()
      @reason = anObject || default_reason
      @weight = default_weight_value
    end

[Source]

# File lib/uttk/status.rb, line 16
    def self.status_name
      name.sub(/^.*?(\w+)Status$/, '\1').upcase.to_sym
    end

Public Instance methods

[Source]

# File lib/uttk/status.rb, line 43
    def hook_name
      self.class.hook_name
    end

[Source]

# File lib/uttk/status.rb, line 55
    def pass?
      false
    end

[Source]

# File lib/uttk/status.rb, line 47
    def to_s
      res = self.class.status_name.to_s
      if @weight != default_weight_value
        res += "(#{@weight.get})"
      end
      res
    end

[Source]

# File lib/uttk/status.rb, line 38
    def to_uttk_log ( log )
      log.status = self.to_s
      log.reason = @reason unless @reason.nil?
    end

[Validate]