Class: Xpub::CallBook::CallSrcFile
- Inherits:
-
Object
- Object
- Xpub::CallBook::CallSrcFile
- Defined in:
- lib/xpub/dsl/src_file.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #debug ⇒ Object
- #full_path ⇒ Object
-
#initialize(file) ⇒ CallSrcFile
constructor
A new instance of CallSrcFile.
- #validate ⇒ Object
Constructor Details
#initialize(file) ⇒ CallSrcFile
Returns a new instance of CallSrcFile.
6 7 8 |
# File 'lib/xpub/dsl/src_file.rb', line 6 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
4 5 6 |
# File 'lib/xpub/dsl/src_file.rb', line 4 def file @file end |
Instance Method Details
#debug ⇒ Object
18 19 20 |
# File 'lib/xpub/dsl/src_file.rb', line 18 def debug p full_path end |
#full_path ⇒ Object
10 11 12 |
# File 'lib/xpub/dsl/src_file.rb', line 10 def full_path "#{Dir.getwd}/src/#{@file}" end |
#validate ⇒ Object
14 15 16 |
# File 'lib/xpub/dsl/src_file.rb', line 14 def validate raise "File does not exist.#{full_path}" unless File.exist? full_path end |