Class: Aio::Module::Description
- Inherits:
-
Object
- Object
- Aio::Module::Description
show all
- Defined in:
- lib/aio/core/module/description.rb
Defined Under Namespace
Classes: CRC, InputErrors, Overrun, ProcRatio, Protocol, Register, Runts, Temp, TotalOutputDrops
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(info = {}) ⇒ Description
8
9
10
11
|
# File 'lib/aio/core/module/description.rb', line 8
def initialize(info={})
@description_info = info.dup
set_defaults()
end
|
Instance Attribute Details
#description_info ⇒ Object
Returns the value of attribute description_info.
6
7
8
|
# File 'lib/aio/core/module/description.rb', line 6
def description_info
@description_info
end
|
Instance Method Details
#author ⇒ Object
59
|
# File 'lib/aio/core/module/description.rb', line 59
def author; description_info[:author]; end
|
#case ⇒ Object
60
|
# File 'lib/aio/core/module/description.rb', line 60
def case; description_info[:case]; end
|
#clear ⇒ Object
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/aio/core/module/description.rb', line 48
def clear
self.description_info = {
:author => nil,
:case => nil,
:name => nil,
:title => nil,
:description => nil,
:license => ::Aio::AIO_LICENSE,
}
end
|
#description ⇒ Object
63
|
# File 'lib/aio/core/module/description.rb', line 63
def description; description_info[:description]; end
|
#license ⇒ Object
64
|
# File 'lib/aio/core/module/description.rb', line 64
def license; description_info[:license]; end
|
#name ⇒ Object
61
|
# File 'lib/aio/core/module/description.rb', line 61
def name; description_info[:name]; end
|
#parent? ⇒ Boolean
34
35
36
|
# File 'lib/aio/core/module/description.rb', line 34
def parent?
self.class == type ? true : false
end
|
#set_defaults ⇒ Object
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/aio/core/module/description.rb', line 13
def set_defaults
self.description_info = {
:author => nil,
:case => nil,
:name => nil,
:title => nil,
:description => nil,
:license => ::Aio::AIO_LICENSE,
}.update(@description_info)
end
|
#temp(cs) ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/aio/core/module/description.rb', line 39
def temp(cs)
clear
@description_info[:case] = cs
@description_info[:name] = cs.to_s.upcase
@description_info[:title] = cs.to_s.upcase + "检查"
self
end
|
#title ⇒ Object
62
|
# File 'lib/aio/core/module/description.rb', line 62
def title; description_info[:title]; end
|
#to_s ⇒ Object
29
30
31
|
# File 'lib/aio/core/module/description.rb', line 29
def to_s
"暂无描述信息。"
end
|
#type ⇒ Object
24
25
26
|
# File 'lib/aio/core/module/description.rb', line 24
def type
Aio::Module::Description
end
|