Class: Ea::Qea::Models::EaAttributeTag
- Inherits:
-
BaseModel
- Object
- Lutaml::Model::Serializable
- BaseModel
- Ea::Qea::Models::EaAttributeTag
- Defined in:
- lib/ea/qea/models/ea_attribute_tag.rb
Overview
EA Attribute Tag model
Represents attribute-level tags (custom key-value metadata) in the t_attributetag table. These are metadata properties specific to GML/XML Schema encoding for attributes.
Constant Summary collapse
- COLUMN_MAP =
{ "PropertyID" => :property_id, "ElementID" => :element_id, }.freeze
Class Method Summary collapse
- .column_map ⇒ Object
-
.primary_key_column ⇒ Symbol
Primary key column name.
-
.table_name ⇒ String
Database table name.
Instance Method Summary collapse
-
#boolean? ⇒ Boolean
Check if property is boolean type.
-
#boolean_value ⇒ Boolean?
Parse boolean value.
-
#integer_value ⇒ Integer?
Parse integer value.
-
#name ⇒ String?
Get property name.
-
#property_value ⇒ String?
Get property value as string.
Methods inherited from BaseModel
from_db_row, #primary_key, #sort_position
Class Method Details
.column_map ⇒ Object
46 47 48 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 46 def self.column_map COLUMN_MAP end |
.primary_key_column ⇒ Symbol
Returns Primary key column name.
31 32 33 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 31 def self.primary_key_column :property_id end |
.table_name ⇒ String
Returns Database table name.
36 37 38 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 36 def self.table_name "t_attributetag" end |
Instance Method Details
#boolean? ⇒ Boolean
Check if property is boolean type
81 82 83 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 81 def boolean? !boolean_value.nil? end |
#boolean_value ⇒ Boolean?
Parse boolean value
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 67 def boolean_value return nil if value.nil? case value.downcase when "true", "1", "yes" true when "false", "0", "no" false end end |
#integer_value ⇒ Integer?
Parse integer value
88 89 90 91 92 93 94 95 96 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 88 def integer_value return nil if value.nil? begin Integer(value) rescue StandardError nil end end |
#name ⇒ String?
Get property name
53 54 55 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 53 def name property end |
#property_value ⇒ String?
Get property value as string
60 61 62 |
# File 'lib/ea/qea/models/ea_attribute_tag.rb', line 60 def property_value value end |