Class: Codshit::Rule
- Inherits:
-
Object
- Object
- Codshit::Rule
- Defined in:
- lib/codshit.rb
Instance Method Summary collapse
- #define(&block) ⇒ Object
-
#initialize ⇒ Rule
constructor
A new instance of Rule.
- #is(*stuff) ⇒ Object
- #to_text ⇒ Object
Constructor Details
Instance Method Details
#define(&block) ⇒ Object
72 73 74 |
# File 'lib/codshit.rb', line 72 def define(&block) instance_eval(&block) end |
#is(*stuff) ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/codshit.rb', line 64 def is(*stuff) if block_given? @is << Choice.new(yield) else @is << stuff end end |
#to_text ⇒ Object
76 77 78 |
# File 'lib/codshit.rb', line 76 def to_text @is.to_text end |