Class: Lutaml::Qea::Models::EaScript
- Defined in:
- lib/lutaml/qea/models/ea_script.rb
Overview
Represents a script from the t_script table in EA database Stores behavioral scripts and debugging configurations
Class Method Summary collapse
-
.from_db_row(row) ⇒ EaScript?
Create from database row.
- .primary_key_column ⇒ Object
- .table_name ⇒ Object
Instance Method Summary collapse
-
#debugging_script? ⇒ Boolean
Check if this is a debugging script.
-
#has_content? ⇒ Boolean
Check if script has content.
-
#has_notes? ⇒ Boolean
Check if script has notes.
Methods inherited from BaseModel
Class Method Details
.from_db_row(row) ⇒ EaScript?
Create from database row
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lutaml/qea/models/ea_script.rb', line 30 def self.from_db_row(row) return nil if row.nil? new( script_id: row["ScriptID"], script_category: row["ScriptCategory"], script_name: row["ScriptName"], script_author: row["ScriptAuthor"], notes: row["Notes"], script: row["Script"], ) end |
.primary_key_column ⇒ Object
18 19 20 |
# File 'lib/lutaml/qea/models/ea_script.rb', line 18 def self.primary_key_column :script_id end |
.table_name ⇒ Object
22 23 24 |
# File 'lib/lutaml/qea/models/ea_script.rb', line 22 def self.table_name "t_script" end |
Instance Method Details
#debugging_script? ⇒ Boolean
Check if this is a debugging script
51 52 53 |
# File 'lib/lutaml/qea/models/ea_script.rb', line 51 def debugging_script? script_category == "ScriptDebugging" end |
#has_content? ⇒ Boolean
Check if script has content
57 58 59 |
# File 'lib/lutaml/qea/models/ea_script.rb', line 57 def has_content? !script.nil? && !script.empty? end |
#has_notes? ⇒ Boolean
Check if script has notes
63 64 65 |
# File 'lib/lutaml/qea/models/ea_script.rb', line 63 def has_notes? !notes.nil? && !notes.empty? end |