Class: Xpub::CallBook::CallSrcFile

Inherits:
Object
  • Object
show all
Defined in:
lib/xpub/dsl/src_file.rb

Direct Known Subclasses

CallImgFile, CallMdFile

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fileObject (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

#debugObject



18
19
20
# File 'lib/xpub/dsl/src_file.rb', line 18

def debug
  p full_path
end

#full_pathObject



10
11
12
# File 'lib/xpub/dsl/src_file.rb', line 10

def full_path
  "#{Dir.getwd}/src/#{@file}"
end

#validateObject



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