Class: CLI::UI::Widgets::Base
- Inherits:
-
Object
- Object
- CLI::UI::Widgets::Base
show all
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/cli/ui/widgets/base.rb
Direct Known Subclasses
Status
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from T::Sig
sig
Methods included from T::Helpers
abstract!, final!, interface!, mixes_in_class_methods, sealed!
Constructor Details
#initialize(argstring) ⇒ Base
Returns a new instance of Base.
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/cli/ui/widgets/base.rb', line 24
def initialize(argstring)
pat = self.class.argparse_pattern
unless (@match_data = pat.match(argstring))
raise(Widgets::InvalidWidgetArguments.new(argstring, pat))
end
@match_data.names.each do |name|
instance_variable_set(:"@#{name}", @match_data[name])
end
end
|
Class Method Details
.argparse_pattern ⇒ Object
39
|
# File 'lib/cli/ui/widgets/base.rb', line 39
def argparse_pattern; end
|
.call(argstring) ⇒ Object
18
19
20
|
# File 'lib/cli/ui/widgets/base.rb', line 18
def call(argstring)
new(argstring).render
end
|
Instance Method Details
#render ⇒ Object
43
|
# File 'lib/cli/ui/widgets/base.rb', line 43
def render; end
|