Class: EasyRspec::OriginalFile
- Inherits:
-
Object
- Object
- EasyRspec::OriginalFile
- Defined in:
- lib/easy_rspec/original_file.rb
Instance Attribute Summary collapse
-
#klass_name ⇒ Object
readonly
Returns the value of attribute klass_name.
Instance Method Summary collapse
- #directory ⇒ Object
-
#initialize(klass_name) ⇒ OriginalFile
constructor
A new instance of OriginalFile.
- #name ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(klass_name) ⇒ OriginalFile
Returns a new instance of OriginalFile.
6 7 8 |
# File 'lib/easy_rspec/original_file.rb', line 6 def initialize(klass_name) @klass_name = Object.const_get(klass_name.to_s) end |
Instance Attribute Details
#klass_name ⇒ Object (readonly)
Returns the value of attribute klass_name.
4 5 6 |
# File 'lib/easy_rspec/original_file.rb', line 4 def klass_name @klass_name end |
Instance Method Details
#directory ⇒ Object
14 15 16 |
# File 'lib/easy_rspec/original_file.rb', line 14 def directory @directory ||= path.split(name).first end |
#name ⇒ Object
18 19 20 |
# File 'lib/easy_rspec/original_file.rb', line 18 def name @name ||= path.split('/').last end |
#path ⇒ Object
10 11 12 |
# File 'lib/easy_rspec/original_file.rb', line 10 def path @path ||= FilePathFinder.new(@klass_name).file_path end |