Chunk::Abstract (Class)

In: app/models/chunks/chunk.rb
Parent: Object

Methods

mask   new   post_mask   pre_mask   revert   unmask  

Attributes

text  [R] 

Public Class methods

[Source]

    # File app/models/chunks/chunk.rb, line 13
13:         def initialize(match_data) @text = match_data[0] end

Public Instance methods

[Source]

    # File app/models/chunks/chunk.rb, line 16
16:         def mask(content) "chunk#{self.object_id}chunk" end

[Source]

    # File app/models/chunks/chunk.rb, line 15
15:         def post_mask() " chunk#{self.object_id}end" end

[Source]

    # File app/models/chunks/chunk.rb, line 14
14:         def pre_mask() "chunk#{self.object_id}start " end

[Source]

    # File app/models/chunks/chunk.rb, line 17
17:         def revert(content) content.sub!( Regexp.new(mask(content)), text ) end

[Source]

    # File app/models/chunks/chunk.rb, line 18
18:         def unmask(content) self if revert(content) end

[Validate]