Class: WhatTheGem::Command
Defined Under Namespace
Classes: Meta
Constant Summary collapse
- HEADER_TEMPLATE =
FIXME: It was > **info.info | paragraphs:1 }** but it looks weird due to tty-markdown bug: github.com/piotrmurach/tty-markdown/issues/11
Template.parse("# {{info.name}}\n> **{{info.info | paragraphs:1 | reflow }}**\n> ({{uris | join:\", \"}})\n\n## {{title}}\n\n\n")
Class Attribute Summary collapse
-
.meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Attribute Summary collapse
-
#gem ⇒ Object
readonly
Returns the value of attribute gem.
Class Method Summary collapse
- .call(*args) ⇒ Object
- .get(handle) ⇒ Object
- .register(title: name.split('::').last, handle: title.downcase, description:) ⇒ Object
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(gem) ⇒ Command
constructor
A new instance of Command.
- #meta ⇒ Object
Constructor Details
#initialize(gem) ⇒ Command
Returns a new instance of Command.
50 51 52 |
# File 'lib/whatthegem/commands.rb', line 50 def initialize(gem) @gem = gem end |
Class Attribute Details
.meta ⇒ Object (readonly)
Returns the value of attribute meta.
12 13 14 |
# File 'lib/whatthegem/commands.rb', line 12 def end |
Instance Attribute Details
#gem ⇒ Object (readonly)
Returns the value of attribute gem.
48 49 50 |
# File 'lib/whatthegem/commands.rb', line 48 def gem @gem end |
Class Method Details
.call(*args) ⇒ Object
27 28 29 |
# File 'lib/whatthegem/commands.rb', line 27 def call(*args) new(*args).call end |
.get(handle) ⇒ Object
23 24 25 |
# File 'lib/whatthegem/commands.rb', line 23 def get(handle) Command.registry[handle] end |
.register(title: name.split('::').last, handle: title.downcase, description:) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/whatthegem/commands.rb', line 14 def register(title: name.split('::').last, handle: title.downcase, description:) Command.registry[handle] = self = Meta.new( handle: handle, title: title, description: description ) end |