Class: Parse::Words

Inherits:
Object show all
Defined in:
lib/ascension/parse.rb

Instance Method Summary collapse

Instance Method Details

#reg_ability(word, ability) ⇒ Object



28
29
30
# File 'lib/ascension/parse.rb', line 28

def reg_ability(word,ability)
  abilities[word.to_s] = ability
end

#reg_word(word, &b) ⇒ Object



22
23
24
25
26
27
# File 'lib/ascension/parse.rb', line 22

def reg_word(word,&b)
  words[word.to_s] = b
  words["first_#{word}"] = lambda do |event|
    b.call(event) && event.first
  end
end