Class: Expert::PomFile

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependencies) ⇒ PomFile

Returns a new instance of PomFile.



42
43
44
# File 'lib/expert/pom_file.rb', line 42

def initialize(dependencies)
  @dependencies = dependencies
end

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



7
8
9
# File 'lib/expert/pom_file.rb', line 7

def dependencies
  @dependencies
end

Class Method Details

.from_path(path) ⇒ Object



10
11
12
# File 'lib/expert/pom_file.rb', line 10

def from_path(path)
  new(load(path))
end

Instance Method Details

#write(path) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/expert/pom_file.rb', line 46

def write(path)
  doc = construct

  File.open(path, 'w+') do |f|
    formatter.write(doc, f)
  end
end