Method: Cog::Embeds#update
- Defined in:
- lib/cog/embeds.rb
#update(c, opt = {}) {|context| ... } ⇒ Boolean?
Returns true if the statement was expanded or updated, false if the statement was found, but not changed, nil if it could not be found.
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/cog/embeds.rb', line 91 def update(c, opt={}, &block) type = opt[:type] || 'cog' Helpers::FileScanner.scan(c.path, statement(type, c.hook), :occurrence => c.actual_index) do |s| c.lineno = s.marked_line_number c.args = s.match[2].split if s.match[2] c.once = !s.match[3].nil? if s.match[4] == '{' update_body c, s, opt, &block else c, s, opt, &block end end end |