Class: BlackBoard::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/blackboard.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, object) ⇒ Data

Returns a new instance of Data.

Raises:



122
123
124
125
126
127
# File 'lib/blackboard.rb', line 122

def initialize name, object
  @name = name
  raise BlackBoardError, "Object does not have timestamp" unless object.respond_to?(:timestamp)
  @data = object
  @timestamp = Time.now
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



120
121
122
# File 'lib/blackboard.rb', line 120

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



120
121
122
# File 'lib/blackboard.rb', line 120

def name
  @name
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



120
121
122
# File 'lib/blackboard.rb', line 120

def timestamp
  @timestamp
end