Class: WatchFile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ WatchFile

refactor: use actual Ruby file objects so that fusion command supports path-completion in ARGV



4
5
6
7
8
# File 'lib/codefusion/watch_file.rb', line 4

def initialize(filename) #refactor: use actual Ruby file objects so that fusion command supports path-completion in ARGV
  @name = filename
  @full_path = Dir.pwd + "/" + @name
  @content = read_file
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



2
3
4
# File 'lib/codefusion/watch_file.rb', line 2

def content
  @content
end

#full_pathObject (readonly)

Returns the value of attribute full_path.



2
3
4
# File 'lib/codefusion/watch_file.rb', line 2

def full_path
  @full_path
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/codefusion/watch_file.rb', line 2

def name
  @name
end

Instance Method Details

#updateObject



10
11
12
# File 'lib/codefusion/watch_file.rb', line 10

def update
  @content = read_file
end