class Viewmatic::View

Represents a view to be built.

Public Class Methods

new(name, materialized: false) click to toggle source

Initialize a new view.

@param name [Symbol] name of the view as it will appear in the database @param materialized [Boolean] true if this is to be a materialized view

# File lib/viewmatic/view.rb, line 12
def initialize(name, materialized: false)
  @name = name
  @materialized = materialized
end

Public Instance Methods

column_names(val = nil) click to toggle source

Get/set the query column name overrides

# File lib/viewmatic/view.rb, line 30
def column_names(val = nil)
  @column_names = val unless val.nil?
  @column_names
end
materialized(val = nil) click to toggle source

Get/set the materialized status

# File lib/viewmatic/view.rb, line 36
def materialized(val = nil)
  @materialized = val unless val.nil?
  @materialized
end
name(val = nil) click to toggle source

Get/set the view name

# File lib/viewmatic/view.rb, line 18
def name(val = nil)
  @name = val unless val.nil?
  @name
end
query(val = nil) click to toggle source

Get/set the query backing the view

# File lib/viewmatic/view.rb, line 24
def query(val = nil)
  @query = val unless val.nil?
  @query
end