Class: Frontman::Builder::File

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/frontman/builder/file.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, status) ⇒ File

Returns a new instance of File.



14
15
16
17
18
19
# File 'lib/frontman/builder/file.rb', line 14

def initialize(path, status)
  raise "#{status} is not a valid file status!" unless valid_status?(status)

  @path = path
  @status = status.to_sym
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



11
12
13
# File 'lib/frontman/builder/file.rb', line 11

def path
  @path
end

#statusObject

Returns the value of attribute status.



11
12
13
# File 'lib/frontman/builder/file.rb', line 11

def status
  @status
end

Class Method Details

.created(path) ⇒ Object



35
36
37
# File 'lib/frontman/builder/file.rb', line 35

def created(path)
  new(path, :created)
end

.deleted(path) ⇒ Object



30
31
32
# File 'lib/frontman/builder/file.rb', line 30

def deleted(path)
  new(path, :deleted)
end

.unchanged(path) ⇒ Object



25
26
27
# File 'lib/frontman/builder/file.rb', line 25

def unchanged(path)
  new(path, :unchanged)
end

.updated(path) ⇒ Object



40
41
42
# File 'lib/frontman/builder/file.rb', line 40

def updated(path)
  new(path, :updated)
end