Class: Processor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_file:, file_content: nil) ⇒ Processor

Returns a new instance of Processor.



20
21
22
23
# File 'lib/dy.rb', line 20

def initialize(source_file:, file_content: nil)
  self.source_file = source_file
  self.file_content = file_content
end

Instance Attribute Details

#file_content=(value) ⇒ Object

Sets the attribute file_content

Parameters:

  • value

    the value to set the attribute file_content to.



17
18
19
# File 'lib/dy.rb', line 17

def file_content=(value)
  @file_content = value
end

#source_fileObject

Returns the value of attribute source_file.



18
19
20
# File 'lib/dy.rb', line 18

def source_file
  @source_file
end

Instance Method Details

#hashObject



25
26
27
28
29
# File 'lib/dy.rb', line 25

def hash
  hash = file_content
  process! hash
  hash
end