Class: OpenHAB::RSpec::Mocks::PersistenceService::HistoricItem

Inherits:
Object
  • Object
show all
Defined in:
lib/openhab/rspec/mocks/persistence_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timestamp, state, name) ⇒ HistoricItem

Returns a new instance of HistoricItem.



24
25
26
27
28
29
# File 'lib/openhab/rspec/mocks/persistence_service.rb', line 24

def initialize(timestamp, state, name)
  @timestamp = timestamp
  @state = state
  @name = name
  @instant = @timestamp.to_instant
end

Instance Attribute Details

#instantObject (readonly)

Returns the value of attribute instant.



22
23
24
# File 'lib/openhab/rspec/mocks/persistence_service.rb', line 22

def instant
  @instant
end

#nameObject (readonly)

Returns the value of attribute name.



22
23
24
# File 'lib/openhab/rspec/mocks/persistence_service.rb', line 22

def name
  @name
end

#stateObject (readonly)

Returns the value of attribute state.



22
23
24
# File 'lib/openhab/rspec/mocks/persistence_service.rb', line 22

def state
  @state
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



22
23
24
# File 'lib/openhab/rspec/mocks/persistence_service.rb', line 22

def timestamp
  @timestamp
end