Class: StackDeck::Frame::Postgres::Function

Inherits:
StackDeck::Frame show all
Defined in:
lib/stackdeck/postgres.rb

Instance Attribute Summary

Attributes inherited from StackDeck::Frame

#clue, #filename, #function, #lineno

Instance Method Summary collapse

Methods inherited from StackDeck::Frame

#boundary?, #same_line?, #to_s

Constructor Details

#initialize(conn, language, function, lineno, clue = nil) ⇒ Function

Returns a new instance of Function.



28
29
30
31
32
# File 'lib/stackdeck/postgres.rb', line 28

def initialize(conn, language, function, lineno, clue=nil)
  @db_connection = conn
  @language = language
  super(function, nil, lineno, clue)
end

Instance Method Details

#contextObject



33
34
35
# File 'lib/stackdeck/postgres.rb', line 33

def context
  @context ||= Context::PgProc.new(@db_connection, function, lineno) if @db_connection
end

#context?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/stackdeck/postgres.rb', line 36

def context?
  !context.nil?
end

#languageObject



39
40
41
# File 'lib/stackdeck/postgres.rb', line 39

def language
  @language.gsub(/ function$/, '')
end