Class: Procps::Column::Type
- Inherits:
-
Object
- Object
- Procps::Column::Type
show all
- Defined in:
- lib/procps/column.rb
Overview
The abstract class for complex column objects.
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(value) ⇒ Type
27
28
29
30
|
# File 'lib/procps/column.rb', line 27
def initialize(value)
@original = value
normalize if self.class.method_defined?(:normalize)
end
|
Instance Attribute Details
#original ⇒ Object
Also known as:
to_s
Returns the value of attribute original.
24
25
26
|
# File 'lib/procps/column.rb', line 24
def original
@original
end
|
Class Method Details
.call(value) ⇒ Object
40
41
42
|
# File 'lib/procps/column.rb', line 40
def self.call(value)
new(value)
end
|
Instance Method Details
#inspect ⇒ Object
36
37
38
|
# File 'lib/procps/column.rb', line 36
def inspect
"<#{self.class}: #{to_h.inspect}>"
end
|
#to_h ⇒ Object
32
33
34
|
# File 'lib/procps/column.rb', line 32
def to_h
Hash[instance_variables.map { |name| [name[1..-1].to_sym, instance_variable_get(name)] }]
end
|