Class: Perpetuity::Postgres::SQLFunction

Inherits:
Object
  • Object
show all
Defined in:
lib/perpetuity/postgres/sql_function.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, *args) ⇒ SQLFunction

Returns a new instance of SQLFunction.



5
6
7
8
# File 'lib/perpetuity/postgres/sql_function.rb', line 5

def initialize name, *args
  @name = name
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



4
5
6
# File 'lib/perpetuity/postgres/sql_function.rb', line 4

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/perpetuity/postgres/sql_function.rb', line 4

def name
  @name
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/perpetuity/postgres/sql_function.rb', line 10

def to_s
  "#{name}(#{args.join(',')})"
end