Class: Danger::Dangerfile::DSL::Plugin
- Inherits:
-
Object
- Object
- Danger::Dangerfile::DSL::Plugin
- Defined in:
- lib/danger/plugin.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dsl) ⇒ Plugin
constructor
A new instance of Plugin.
-
#method_missing(method_sym, *arguments, &_block) ⇒ Object
Since we have a reference to the DSL containing all the information We need to redirect the self calls to the DSL.
- #run ⇒ Object
Constructor Details
#initialize(dsl) ⇒ Plugin
Returns a new instance of Plugin.
5 6 7 |
# File 'lib/danger/plugin.rb', line 5 def initialize(dsl) @dsl = dsl end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_sym, *arguments, &_block) ⇒ Object
Since we have a reference to the DSL containing all the information We need to redirect the self calls to the DSL
11 12 13 14 |
# File 'lib/danger/plugin.rb', line 11 def method_missing(method_sym, *arguments, &_block) return @dsl.send(method_sym, *arguments) if @dsl.respond_to?(method_sym) return @dsl.method_missing(method_sym, *arguments) end |
Class Method Details
.description ⇒ Object
20 21 22 |
# File 'lib/danger/plugin.rb', line 20 def self.description "Add plugin description here" end |
Instance Method Details
#run ⇒ Object
16 17 18 |
# File 'lib/danger/plugin.rb', line 16 def run raise "run method must be implemented" end |