Class: Lutaml::Qea::Models::EaDocument
- Defined in:
- lib/lutaml/qea/models/ea_document.rb
Overview
Represents a document from the t_document table in EA database Stores documentation style templates and artifacts
Class Method Summary collapse
-
.from_db_row(row) ⇒ EaDocument?
Create from database row.
- .primary_key_column ⇒ Object
- .table_name ⇒ Object
Instance Method Summary collapse
-
#has_binary_content? ⇒ Boolean
Check if document has binary content.
-
#has_content? ⇒ Boolean
Check if document has string content.
-
#style_document? ⇒ Boolean
Check if this is a style document.
Methods inherited from BaseModel
Class Method Details
.from_db_row(row) ⇒ EaDocument?
Create from database row
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 30 def self.from_db_row(row) return nil if row.nil? new( doc_id: row["DocID"], doc_name: row["DocName"], doc_type: row["DocType"], str_content: row["StrContent"], bin_content: row["BinContent"], element_id: row["ElementID"], ) end |
.primary_key_column ⇒ Object
18 19 20 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 18 def self.primary_key_column :doc_id end |
.table_name ⇒ Object
22 23 24 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 22 def self.table_name "t_document" end |
Instance Method Details
#has_binary_content? ⇒ Boolean
Check if document has binary content
62 63 64 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 62 def has_binary_content? !bin_content.nil? && !bin_content.empty? end |
#has_content? ⇒ Boolean
Check if document has string content
56 57 58 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 56 def has_content? !str_content.nil? && !str_content.empty? end |
#style_document? ⇒ Boolean
Check if this is a style document
50 51 52 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 50 def style_document? doc_type == "SSDOCSTYLE" end |