Class: Log::Priority

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/ec2/amitools/util.rb

Overview

—————————————————————————-#

Constant Summary collapse

EMERG =

0

new "EMERG"
ALERT =

1

new "ALERT"
CRIT =

2

new "CRIT"
ERR =

3

new "ERR"
WARNING =

4

new "WARNING"
NOTICE =

5

new "NOTICE"
INFO =

6

new "INFO"
DEBUG =

7

new "DEBUG"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Priority

Returns a new instance of Priority.



212
213
214
215
# File 'lib/ec2/amitools/util.rb', line 212

def initialize(name)
  @name = name
  @value = eval("Syslog::LOG_#{name}")
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



227
228
229
# File 'lib/ec2/amitools/util.rb', line 227

def name
  @name
end

#valueObject

Returns the value of attribute value.



226
227
228
# File 'lib/ec2/amitools/util.rb', line 226

def value
  @value
end

Instance Method Details

#<=>(priority) ⇒ Object



229
230
231
# File 'lib/ec2/amitools/util.rb', line 229

def <=>(priority)
  @value <=> priority.value
end

#to_sObject



233
234
235
# File 'lib/ec2/amitools/util.rb', line 233

def to_s
  "Priority[LOG_#{@name}]"
end