Class: PgGnostic::Tables

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_gnostic/view_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



41
42
43
44
# File 'lib/pg_gnostic/view_definition.rb', line 41

def method_missing(name)
  return ViewDefinition.predifined_fields[name] if ViewDefinition.predifined_fields[name]
  return TableDesc.new(name)
end

Instance Attribute Details

#sqlObject

Returns the value of attribute sql.



32
33
34
# File 'lib/pg_gnostic/view_definition.rb', line 32

def sql
  @sql
end

Instance Method Details

#pnameObject



33
34
35
# File 'lib/pg_gnostic/view_definition.rb', line 33

def pname
  %Q[format_name(patients.name)]
end

#timestampsObject



37
38
39
# File 'lib/pg_gnostic/view_definition.rb', line 37

def timestamps
  ['created_at','updated_at']
end