Class: GitShizzle::Dsl::CommandContext
- Inherits:
-
Object
- Object
- GitShizzle::Dsl::CommandContext
- Defined in:
- lib/git_shizzle/dsl/command_context.rb
Instance Method Summary collapse
- #action(&block) ⇒ Object
- #applies_to(&block) ⇒ Object
-
#initialize(command) ⇒ CommandContext
constructor
A new instance of CommandContext.
Constructor Details
#initialize(command) ⇒ CommandContext
Returns a new instance of CommandContext.
5 6 7 |
# File 'lib/git_shizzle/dsl/command_context.rb', line 5 def initialize(command) @command = command end |
Instance Method Details
#action(&block) ⇒ Object
14 15 16 17 |
# File 'lib/git_shizzle/dsl/command_context.rb', line 14 def action(&block) raise CommandDefinitionError.new(@command, '#action requires a block.') unless block_given? @command.set_action block end |
#applies_to(&block) ⇒ Object
9 10 11 12 |
# File 'lib/git_shizzle/dsl/command_context.rb', line 9 def applies_to(&block) raise CommandDefinitionError.new(@command, '#applies_to requires a block.') unless block_given? @command.set_filter block end |