Class: Script

Inherits:
Object
  • Object
show all
Defined in:
lib/cuco/script.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Script



4
5
6
7
# File 'lib/cuco/script.rb', line 4

def initialize(str)
  @__rules = []
  instance_eval str
end

Instance Attribute Details

#__rulesObject (readonly)

Returns the value of attribute __rules.



2
3
4
# File 'lib/cuco/script.rb', line 2

def __rules
  @__rules
end

Instance Method Details

#watch(pattern, type = nil, &block) ⇒ Object



9
10
11
# File 'lib/cuco/script.rb', line 9

def watch(pattern, type = nil, &block)
  @__rules << Rule.new(pattern, type, block)
end