Module: Hakuban::ObjectManager::ExposedObject

Defined in:
lib/hakuban/hakuban.rb

Instance Method Summary collapse

Instance Method Details

#data=(value) ⇒ Object



541
542
543
544
545
546
547
548
# File 'lib/hakuban/hakuban.rb', line 541

def data=(value)
  timestamp = Time.new.to_f.floor
  if @contract.method(:set_object_state).arity == 4
    @contract.set_object_state(@descriptor,[1, timestamp.floor, ((timestamp - timestamp.floor)*1000000000).floor, 0],[],value)
  else 
    @contract.set_object_state([1, timestamp.floor, ((timestamp - timestamp.floor)*1000000000).floor, 0],[],value)
  end
end

#state=(state) ⇒ Object



534
535
536
537
538
539
540
# File 'lib/hakuban/hakuban.rb', line 534

def state=(state)
  if @contract.method(:set_object_state).arity == 4
    @contract.set_object_state(@descriptor, *state)
  else
    @contract.set_object_state(*state)
  end
end