Class: ProxyTester::GitFile
- Inherits:
-
Object
- Object
- ProxyTester::GitFile
- Defined in:
- lib/proxy_tester/git_file.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #extension?(ext) ⇒ Boolean
-
#initialize(path, content = '') ⇒ GitFile
constructor
A new instance of GitFile.
- #nil? ⇒ Boolean
- #prepare(handler) ⇒ Object
Constructor Details
#initialize(path, content = '') ⇒ GitFile
Returns a new instance of GitFile.
12 13 14 15 16 17 |
# File 'lib/proxy_tester/git_file.rb', line 12 def initialize(path, content = '') @path = path @extension = ::File.extname(path) @name = path.sub(/\.[^.]+$/, '').gsub(%r{/}, '::').downcase.to_sym @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
10 11 12 |
# File 'lib/proxy_tester/git_file.rb', line 10 def content @content end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/proxy_tester/git_file.rb', line 10 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/proxy_tester/git_file.rb', line 10 def path @path end |
Instance Method Details
#extension?(ext) ⇒ Boolean
23 24 25 |
# File 'lib/proxy_tester/git_file.rb', line 23 def extension?(ext) extension == ext end |
#nil? ⇒ Boolean
19 20 21 |
# File 'lib/proxy_tester/git_file.rb', line 19 def nil? false end |
#prepare(handler) ⇒ Object
27 28 29 |
# File 'lib/proxy_tester/git_file.rb', line 27 def prepare(handler) handler.prepare(self) end |