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.
46
47
48
|
# File 'lib/tty_string/code.rb', line 46
def initialize(parser)
@parser = parser
end
|
Class Method Details
.char(value = nil) ⇒ Object
26
27
28
29
|
# File 'lib/tty_string/code.rb', line 26
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
15
16
|
# File 'lib/tty_string/code.rb', line 10
def inherited(klass)
@@descendants ||= [] @@descendants << klass
@@descendants.uniq!
super
end
|
.render(parser) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/tty_string/code.rb', line 18
def render(parser)
return unless match?(parser)
new(parser).action(*args(parser))
true
end
|
Instance Method Details
#action ⇒ Object
50
|
# File 'lib/tty_string/code.rb', line 50
def action; end
|