Class: TTYString::Code
- Inherits:
-
Object
show all
- Defined in:
- lib/tty_string/code.rb,
lib/tty_string/code_definitions.rb
Defined Under Namespace
Classes: SlashA, SlashB, SlashN, SlashR, SlashT
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(parser) ⇒ Code
Returns a new instance of Code.
44
45
46
|
# File 'lib/tty_string/code.rb', line 44
def initialize(parser)
@parser = parser
end
|
Class Method Details
.char(value = nil) ⇒ Object
24
25
26
27
|
# File 'lib/tty_string/code.rb', line 24
def char(value = nil)
@char = value if value
@char ||= name.split('::').last
end
|
.descendants ⇒ Object
6
7
8
|
# File 'lib/tty_string/code.rb', line 6
def descendants
@@descendants
end
|
.inherited(klass) ⇒ Object
10
11
12
13
14
|
# File 'lib/tty_string/code.rb', line 10
def inherited(klass)
@@descendants ||= [] @@descendants << klass
@@descendants.uniq!
end
|
.render(parser) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/tty_string/code.rb', line 16
def render(parser)
return unless match?(parser)
new(parser).action(*args(parser))
true
end
|
Instance Method Details
#action ⇒ Object
48
|
# File 'lib/tty_string/code.rb', line 48
def action; end
|