Class: Hakuban::ObjectManager::ExposedObject

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

Instance Attribute Summary

Attributes inherited from ManagedObject

#contract, #descriptor

Instance Method Summary collapse

Methods inherited from ManagedObject

#initialize

Constructor Details

This class inherits a constructor from Hakuban::ObjectManager::ManagedObject

Instance Method Details

#data=(value) ⇒ Object



684
685
686
# File 'lib/hakuban/hakuban.rb', line 684

def data=(value)
	data_set(value)
end

#data_set(value) ⇒ Object



676
677
678
679
680
681
682
683
# File 'lib/hakuban/hakuban.rb', line 676

def data_set(value)
	timestamp = Time.new.to_f
	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



673
674
675
# File 'lib/hakuban/hakuban.rb', line 673

def state=(state)
	state_set(state)
end

#state_set(state) ⇒ Object



666
667
668
669
670
671
672
# File 'lib/hakuban/hakuban.rb', line 666

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