Class: Transpec::ProcessedSource
- Inherits:
-
Object
- Object
- Transpec::ProcessedSource
- Defined in:
- lib/transpec/processed_source.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source, path = nil) ⇒ ProcessedSource
constructor
A new instance of ProcessedSource.
- #to_s ⇒ Object
Constructor Details
#initialize(source, path = nil) ⇒ ProcessedSource
Returns a new instance of ProcessedSource.
19 20 21 22 |
# File 'lib/transpec/processed_source.rb', line 19 def initialize(source, path = nil) @path = path parse(source) end |
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
12 13 14 |
# File 'lib/transpec/processed_source.rb', line 12 def ast @ast end |
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
12 13 14 |
# File 'lib/transpec/processed_source.rb', line 12 def buffer @buffer end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
12 13 14 |
# File 'lib/transpec/processed_source.rb', line 12 def error @error end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/transpec/processed_source.rb', line 12 def path @path end |
Class Method Details
.from_file(path) ⇒ Object
14 15 16 17 |
# File 'lib/transpec/processed_source.rb', line 14 def self.from_file(path) source = File.read(path) new(source, path) end |
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'lib/transpec/processed_source.rb', line 24 def to_s buffer.source end |