Class: Elsmore::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/elsmore/writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ Writer

Returns a new instance of Writer.



5
6
7
# File 'lib/elsmore/writer.rb', line 5

def initialize resource
  self.resource = resource
end

Instance Attribute Details

#emitterObject

Returns the value of attribute emitter.



3
4
5
# File 'lib/elsmore/writer.rb', line 3

def emitter
  @emitter
end

#resourceObject

Returns the value of attribute resource.



3
4
5
# File 'lib/elsmore/writer.rb', line 3

def resource
  @resource
end

Instance Method Details

#canonical_filenameObject



13
14
15
16
17
18
19
# File 'lib/elsmore/writer.rb', line 13

def canonical_filename
  if host == parent_host
    "#{filename}"
  else
    "/#{host}#{filename}"
  end
end

#writeObject



9
10
11
# File 'lib/elsmore/writer.rb', line 9

def write
  write_file
end