Class: Commento::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/commento/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter) ⇒ DSL

Public: Returns a new instance of the DSL.

adapter - The adapter that this DSL instance should use.



10
11
12
# File 'lib/commento/dsl.rb', line 10

def initialize(adapter)
  @adapter = adapter
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



5
6
7
# File 'lib/commento/dsl.rb', line 5

def adapter
  @adapter
end

Instance Method Details

#fetch_column_comment(table_name, column_name) ⇒ Object

Public: Returns comment for table’s column.



30
31
32
# File 'lib/commento/dsl.rb', line 30

def fetch_column_comment(table_name, column_name)
  adapter.fetch_column_comment(table_name, column_name)
end

#fetch_comments_for_databaseObject

Public: Returns comments for tables and columns.



35
36
37
# File 'lib/commento/dsl.rb', line 35

def fetch_comments_for_database
  adapter.fetch_comments_for_database
end

#fetch_table_comment(table_name) ⇒ Object

Public: Returns comment for table.



20
21
22
# File 'lib/commento/dsl.rb', line 20

def fetch_table_comment(table_name)
  adapter.fetch_table_comment(table_name)
end

#set_column_comment(table_name, column_name, value) ⇒ Object

Public: Sets comment for table’s column.



25
26
27
# File 'lib/commento/dsl.rb', line 25

def set_column_comment(table_name, column_name, value)
  adapter.set_column_comment(table_name, column_name, value)
end

#set_table_comment(table_name, value) ⇒ Object

Public: Sets comment for table.



15
16
17
# File 'lib/commento/dsl.rb', line 15

def set_table_comment(table_name, value)
  adapter.set_table_comment(table_name, value)
end