Module: Writer
- Defined in:
- lib/writer.rb,
lib/writer/version.rb,
lib/writer/file_namer.rb,
lib/writer/file_creator.rb,
lib/writer/configuration.rb
Defined Under Namespace
Classes: Configuration, FileCreator, FileNamer
Constant Summary
collapse
- VERSION =
"0.3.1"
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
24
25
26
|
# File 'lib/writer.rb', line 24
def config
@config ||= Configuration.new
end
|
.config=(other) ⇒ Object
20
21
22
|
# File 'lib/writer.rb', line 20
def config=(other)
@config = other
end
|
11
12
13
|
# File 'lib/writer.rb', line 11
def configure
yield(config)
end
|
.method_missing(name, *args) ⇒ Object
attempt delegation to config
16
17
18
|
# File 'lib/writer.rb', line 16
def method_missing(name, *args)
config.send(name, *args)
end
|
.write!(name = nil, content = nil) ⇒ Object
6
7
8
9
|
# File 'lib/writer.rb', line 6
def write!(name = nil, content = nil)
name = namer.name_for(name)
creator.create!(name, content)
end
|