Module: Cdss::Concerns::LogReadingAttributes
- Included in:
- Models::Reading
- Defined in:
- lib/cdss/concerns/log_reading_attributes.rb
Overview
A concern module that adds log reading-related attributes to classes.
This module provides a set of standardized attributes for log reading data, including aquifer information, depth measurements, elevation, and comments. When included in a class, it dynamically adds accessor methods for these attributes.
Constant Summary collapse
- LOG_ATTRIBUTES =
Predefined list of log reading attributes
%i[ aquifer g_log_top_depth g_log_base_depth g_log_top_elev g_log_base_elev g_log_thickness comment ].freeze
Class Method Summary collapse
-
.included(base) ⇒ Object
Dynamically adds accessor methods when the module is included in a class.
Instance Method Summary collapse
-
#log_reading? ⇒ Boolean
Checks if the instance has log reading data.
Class Method Details
.included(base) ⇒ Object
Dynamically adds accessor methods when the module is included in a class
32 33 34 35 36 |
# File 'lib/cdss/concerns/log_reading_attributes.rb', line 32 def self.included(base) base.class_eval do attr_accessor(*LOG_ATTRIBUTES) end end |
Instance Method Details
#log_reading? ⇒ Boolean
Checks if the instance has log reading data
43 44 45 |
# File 'lib/cdss/concerns/log_reading_attributes.rb', line 43 def log_reading? !aquifer.nil? || !g_log_thickness.nil? end |