Class: Log::Priority
- Inherits:
-
Object
- Object
- Log::Priority
- 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
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(priority) ⇒ Object
-
#initialize(name) ⇒ Priority
constructor
A new instance of Priority.
- #to_s ⇒ Object
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
#name ⇒ Object
Returns the value of attribute name.
227 228 229 |
# File 'lib/ec2/amitools/util.rb', line 227 def name @name end |
#value ⇒ Object
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_s ⇒ Object
233 234 235 |
# File 'lib/ec2/amitools/util.rb', line 233 def to_s "Priority[LOG_#{@name}]" end |