Class: FixerUpper
- Inherits:
-
Object
show all
- Defined in:
- lib/fixer_upper.rb,
lib/fixer_upper/error.rb,
lib/fixer_upper/version.rb,
lib/fixer_upper/renovation.rb
Defined Under Namespace
Classes: Error, Renovation
Constant Summary
collapse
- VERSION =
"0.1.0".freeze
Instance Method Summary
collapse
Constructor Details
Returns a new instance of FixerUpper.
6
7
8
9
|
# File 'lib/fixer_upper.rb', line 6
def initialize
@engine_registry = {}
@renovation = Renovation.new(@engine_registry)
end
|
Instance Method Details
#[](key) ⇒ Object
17
18
19
|
# File 'lib/fixer_upper.rb', line 17
def [](key)
@engine_registry[key]
end
|
#[]=(*keys, engine) ⇒ Object
11
12
13
14
15
|
# File 'lib/fixer_upper.rb', line 11
def []=(*keys, engine)
keys.each do |key|
@engine_registry[key] = engine
end
end
|
#diy(text, engines) ⇒ Object
29
30
31
|
# File 'lib/fixer_upper.rb', line 29
def diy(text, engines)
@renovation.diy(text, engines, bang: false)
end
|
#diy!(text, engines) ⇒ Object
33
34
35
|
# File 'lib/fixer_upper.rb', line 33
def diy!(text, engines)
@renovation.diy(text, engines, bang: true)
end
|
#renovate(filepath, contents = nil) ⇒ Object
21
22
23
|
# File 'lib/fixer_upper.rb', line 21
def renovate(filepath, contents = nil)
@renovation.renovate(filepath, contents, bang: false)
end
|
#renovate!(filepath, contents = nil) ⇒ Object
25
26
27
|
# File 'lib/fixer_upper.rb', line 25
def renovate!(filepath, contents = nil)
@renovation.renovate(filepath, contents, bang: true)
end
|