Class: AngularConfig::File
- Inherits:
-
Object
- Object
- AngularConfig::File
- Defined in:
- lib/angular_config/file.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #content ⇒ Object
- #content=(data) ⇒ Object
-
#initialize(source_path) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(source_path) ⇒ File
Returns a new instance of File.
5 6 7 |
# File 'lib/angular_config/file.rb', line 5 def initialize(source_path) @path = ::File.(source_path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/angular_config/file.rb', line 3 def path @path end |
Instance Method Details
#content ⇒ Object
9 10 11 |
# File 'lib/angular_config/file.rb', line 9 def content ::File.read(path).chomp end |
#content=(data) ⇒ Object
13 14 15 16 17 |
# File 'lib/angular_config/file.rb', line 13 def content=(data) ::File.open(path, "w") do |file| file.write(data) end end |