Class: StackDeck::Frame
- Inherits:
-
Object
- Object
- StackDeck::Frame
- Defined in:
- lib/stackdeck/frame.rb,
lib/stackdeck/postgres.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Postgres Classes: JavaScript, Ruby, SQL
Instance Attribute Summary collapse
-
#clue ⇒ Object
Returns the value of attribute clue.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#function ⇒ Object
Returns the value of attribute function.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
Instance Method Summary collapse
- #boundary? ⇒ Boolean
- #context ⇒ Object
-
#initialize(function, filename, lineno, clue = nil) ⇒ Frame
constructor
A new instance of Frame.
- #language ⇒ Object
- #same_line?(other) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(function, filename, lineno, clue = nil) ⇒ Frame
Returns a new instance of Frame.
28 29 30 31 32 33 |
# File 'lib/stackdeck/frame.rb', line 28 def initialize(function, filename, lineno, clue=nil) @function = function @filename = filename unless filename && filename.empty? @lineno = lineno @clue = clue unless clue && clue.empty? end |
Instance Attribute Details
#clue ⇒ Object
Returns the value of attribute clue.
27 28 29 |
# File 'lib/stackdeck/frame.rb', line 27 def clue @clue end |
#filename ⇒ Object
Returns the value of attribute filename.
27 28 29 |
# File 'lib/stackdeck/frame.rb', line 27 def filename @filename end |
#function ⇒ Object
Returns the value of attribute function.
27 28 29 |
# File 'lib/stackdeck/frame.rb', line 27 def function @function end |
#lineno ⇒ Object
Returns the value of attribute lineno.
27 28 29 |
# File 'lib/stackdeck/frame.rb', line 27 def lineno @lineno end |
Instance Method Details
#boundary? ⇒ Boolean
41 |
# File 'lib/stackdeck/frame.rb', line 41 def boundary?; false; end |
#context ⇒ Object
34 35 36 |
# File 'lib/stackdeck/frame.rb', line 34 def context @context ||= Context::File.new(filename, lineno) if filename end |
#language ⇒ Object
40 |
# File 'lib/stackdeck/frame.rb', line 40 def language; self.class.name.split('::').last; end |
#same_line?(other) ⇒ Boolean
37 38 39 |
# File 'lib/stackdeck/frame.rb', line 37 def same_line?(other) other && self.filename == other.filename && self.lineno == other.lineno end |
#to_s ⇒ Object
43 44 45 |
# File 'lib/stackdeck/frame.rb', line 43 def to_s "#{filename}:#{lineno}: in `#{function}' [#{language}]" end |