Class: SqlView::Model
- Inherits:
-
Object
- Object
- SqlView::Model
- Defined in:
- lib/sql_view.rb
Class Method Summary collapse
- .extend_model_with(&block) ⇒ Object
- .inherited(subclass) ⇒ Object
- .materialized ⇒ Object
- .model ⇒ Object
- .schema(sql_or_proc) ⇒ Object
- .sql_view ⇒ Object
- .view_name ⇒ Object
- .view_name=(name) ⇒ Object
Class Method Details
.extend_model_with(&block) ⇒ Object
54 55 56 |
# File 'lib/sql_view.rb', line 54 def self.extend_model_with(&block) self.[:extend_model_with] = block end |
.inherited(subclass) ⇒ Object
26 27 28 |
# File 'lib/sql_view.rb', line 26 def self.inherited(subclass) subclass. = {} end |
.materialized ⇒ Object
46 47 48 |
# File 'lib/sql_view.rb', line 46 def self.materialized self.[:materialized] = true end |
.model ⇒ Object
38 39 40 |
# File 'lib/sql_view.rb', line 38 def self.model @model ||= ClassBuilder.create_model(self) end |
.schema(sql_or_proc) ⇒ Object
50 51 52 |
# File 'lib/sql_view.rb', line 50 def self.schema(sql_or_proc) self.[:sql_or_proc] = sql_or_proc end |
.sql_view ⇒ Object
42 43 44 |
# File 'lib/sql_view.rb', line 42 def self.sql_view @sql_view ||= Migration.new(self) end |
.view_name ⇒ Object
34 35 36 |
# File 'lib/sql_view.rb', line 34 def self.view_name @view_name.presence || (self.view_name=self.to_s.underscore.pluralize) end |
.view_name=(name) ⇒ Object
30 31 32 |
# File 'lib/sql_view.rb', line 30 def self.view_name=(name) @view_name = name end |