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.
22 23 24 25 |
# File 'lib/transpec/processed_source.rb', line 22 def initialize(source, path = nil) @path = path parse(source) end |
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
15 16 17 |
# File 'lib/transpec/processed_source.rb', line 15 def ast @ast end |
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
15 16 17 |
# File 'lib/transpec/processed_source.rb', line 15 def buffer @buffer end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
15 16 17 |
# File 'lib/transpec/processed_source.rb', line 15 def error @error end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
15 16 17 |
# File 'lib/transpec/processed_source.rb', line 15 def path @path end |
Class Method Details
.from_file(path) ⇒ Object
17 18 19 20 |
# File 'lib/transpec/processed_source.rb', line 17 def self.from_file(path) source = File.read(path) new(source, path) end |
Instance Method Details
#to_s ⇒ Object
27 28 29 |
# File 'lib/transpec/processed_source.rb', line 27 def to_s buffer.source end |