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
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 28 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
16 17 18 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 16 def self.primary_key_column :doc_id end |
.table_name ⇒ Object
20 21 22 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 20 def self.table_name "t_document" end |
Instance Method Details
#has_binary_content? ⇒ Boolean
Check if document has binary content
60 61 62 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 60 def has_binary_content? !bin_content.nil? && !bin_content.empty? end |
#has_content? ⇒ Boolean
Check if document has string content
54 55 56 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 54 def has_content? !str_content.nil? && !str_content.empty? end |
#style_document? ⇒ Boolean
Check if this is a style document
48 49 50 |
# File 'lib/lutaml/qea/models/ea_document.rb', line 48 def style_document? doc_type == "SSDOCSTYLE" end |