Module: Drudge::ClassDSL::ClassMethods
- Defined in:
- lib/drudge/class_dsl.rb
Instance Method Summary collapse
- #__commands ⇒ Object
-
#desc(description) ⇒ Object
When found before a method definition, it marks the Provides a short description for the next command.
- #method_added(m) ⇒ Object
Instance Method Details
#__commands ⇒ Object
55 56 57 |
# File 'lib/drudge/class_dsl.rb', line 55 def __commands merged_commands((@__commands || []), (superclass.__commands rescue [])) end |
#desc(description) ⇒ Object
When found before a method definition, it marks the Provides a short description for the next command
35 36 37 38 |
# File 'lib/drudge/class_dsl.rb', line 35 def desc(description) ||= {} [:desc] = description end |
#method_added(m) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/drudge/class_dsl.rb', line 40 def method_added(m) if and [:desc] meth = instance_method(m) @__commands ||= [] @__commands << { name: meth.name, params: parse_command_parameters(meth.parameters), meta: { desc: [:desc] } } = {} end super end |