Class: OpenHAB::Core::Items::Persistence::HistoricState
- Inherits:
 - 
      SimpleDelegator
      
        
- Object
 - SimpleDelegator
 - OpenHAB::Core::Items::Persistence::HistoricState
 
 
- Defined in:
 - lib/openhab/core/items/persistence.rb
 
Overview
A state class with an added timestamp attribute.
This wraps HistoricItem to allow implicitly treating the object as its state, and wrapping of that state into a QuantityType as necessary.
Instance Attribute Summary collapse
- #state ⇒ Types::State readonly
 - #timestamp ⇒ ZonedDateTime readonly
 
Instance Method Summary collapse
- 
  
    
      #initialize(state, historic_item)  ⇒ HistoricState 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of HistoricState.
 
Constructor Details
#initialize(state, historic_item) ⇒ HistoricState
Returns a new instance of HistoricState.
      55 56 57 58  | 
    
      # File 'lib/openhab/core/items/persistence.rb', line 55 def initialize(state, historic_item) @historic_item = historic_item super(state) end  | 
  
Instance Attribute Details
#state ⇒ Types::State (readonly)
      53  | 
    
      # File 'lib/openhab/core/items/persistence.rb', line 53 alias_method :state, :__getobj__  | 
  
#timestamp ⇒ ZonedDateTime (readonly)
      62 63 64  | 
    
      # File 'lib/openhab/core/items/persistence.rb', line 62 def timestamp @historic_item.timestamp end  |