Module: MadderLib::Conditional::Allowed::Phrase

Included in:
Phrase
Defined in:
lib/madderlib/conditional/allowed.rb

Overview

Allowed::Phrase

Introduces support for conditional usage of an Instruction

If a Phrase has no Instructions that can be used, it will return an empty result and be omitted

See: Allowed::Instruction

Instance Method Summary collapse

Instance Method Details

#assuming(*args, &block) ⇒ Object Also known as: presuming, if

Adds conditional logic to the current Instruction

See: Instruction#assuming



19
20
21
# File 'lib/madderlib/conditional/allowed.rb', line 19

def assuming(*args, &block)
	self.instruction.assuming *args, &block
end

#forbidding(*args, &block) ⇒ Object Also known as: unless

Adds conditional logic to the current Instruction

See: Instruction#forbidding



28
29
30
# File 'lib/madderlib/conditional/allowed.rb', line 28

def forbidding(*args, &block)
	self.instruction.forbidding *args, &block
end