Class: RhetButler::Stasis::DocumentTransform

Inherits:
Object
  • Object
show all
Defined in:
lib/rhet-butler/stasis/document-transform.rb

Direct Known Subclasses

CSSTransform, HTMLTransform, IdentityTransform

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#documentObject

Returns the value of attribute document.



9
10
11
# File 'lib/rhet-butler/stasis/document-transform.rb', line 9

def document
  @document
end

#queueObject

Returns the value of attribute queue.



9
10
11
# File 'lib/rhet-butler/stasis/document-transform.rb', line 9

def queue
  @queue
end

#target_pathObject

Returns the value of attribute target_path.



9
10
11
# File 'lib/rhet-butler/stasis/document-transform.rb', line 9

def target_path
  @target_path
end

Class Method Details

.register(type) ⇒ Object



5
6
7
# File 'lib/rhet-butler/stasis/document-transform.rb', line 5

def self.register(type)
  TransformQueue.register(type, self)
end

Instance Method Details

#document_sourceObject



11
12
13
# File 'lib/rhet-butler/stasis/document-transform.rb', line 11

def document_source
  @document.source_uri
end


27
28
29
# File 'lib/rhet-butler/stasis/document-transform.rb', line 27

def get_link_translation(link)
  queue.target_for(document, document_source).route_to(queue.target_for(document, link))
end

#processObject



19
20
21
22
23
24
25
# File 'lib/rhet-butler/stasis/document-transform.rb', line 19

def process
  parse_document

  translate_links

  save_document
end

#save_documentObject



15
16
17
# File 'lib/rhet-butler/stasis/document-transform.rb', line 15

def save_document
  @queue.write_document(target_path, render_document)
end