Module: Alula::Dcp::StagedValueMethods
- Included in:
- Config::BusModules::BusModule, Config::CommData::AutoCommTestInterval, Config::CommData::ServerHeartbeats, Config::CommData::ServerKeepAlives, Config::PanelOptions::AcFailDetectDelay, Config::PanelOptions::EventReportingDelay, Config::PanelOptions::KeyFobButtonFunctions, Config::PanelOptions::MinimumPinSize, Config::PanelOptions::PanelLedBrightness, Config::PanelOptions::PanelMiscOptions, Config::PanelOptions::PanelOptions, Config::PanelOptions::ReportableEventTypesPartitions, Config::PanelOptions::ReportableEventTypesSystem, Config::PanelOptions::SwingerThreshold, Config::PanelOptions::SystemOptions, Config::PanelOptions::TroubleBeepSuppress, Config::PanelOptions::VirtualInterfaceOptions, Config::Partitions::Partition, Config::SirenData::Siren, Config::Timers::EntryDelays, Config::Timers::ExitDelays, Config::Timers::SensorSupervisionTime, Config::Timers::SirenTimeout, Config::UsersData::DuressPin, Config::UsersData::InstallerPin, Config::UsersData::User
- Defined in:
- lib/alula/dcp/staged_value_methods.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/alula/dcp/staged_value_methods.rb', line 6 def self.included(base) base.class_eval do class << self attr_writer :has_svm def has_svm @has_svm ||= true end end end end |
Instance Method Details
#primitive?(resource) ⇒ Boolean
45 46 47 |
# File 'lib/alula/dcp/staged_value_methods.rb', line 45 def primitive?(resource) resource.class.get_fields[:primitive] end |
#staged ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/alula/dcp/staged_value_methods.rb', line 18 def staged return nil if values['staged'].nil? if primitive?(self) # define setter method for staged value define_singleton_method :staged= do |value| values['staged'] = value end return values['staged'] end @staged ||= StagedState.new(self) end |
#value ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/alula/dcp/staged_value_methods.rb', line 32 def value return nil if values['value'].nil? if primitive?(self) # define setter method for value define_singleton_method :value= do |value| values['value'] = value end return values['value'] end @value ||= ValueState.new(self) end |