Class: Hakuban::ObjectManager::ObservedObject

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

Overview

TODO: remove the arity thing…

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

#dataObject



656
657
658
659
660
661
662
# File 'lib/hakuban/hakuban.rb', line 656

def data
  if @contract.method(:object_state).arity == 1
    @contract.object_state(@descriptor)&.data
  else
    @contract.object_state&.data
  end
end

#stateObject



649
650
651
652
653
654
655
# File 'lib/hakuban/hakuban.rb', line 649

def state
  if @contract.method(:object_state).arity == 1
    @contract.object_state(@descriptor)
  else
    @contract.object_state
  end
end