Class: ArcadiaContract::ContractEvent

Inherits:
Object
  • Object
show all
Defined in:
ext/ae-rad/ae-rad-libs.rb

Constant Summary collapse

SIGNATURE =
"NOT_DEFINED"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_contract, _signature = SIGNATURE, _context = nil) ⇒ ContractEvent

Returns a new instance of ContractEvent.



900
901
902
903
904
905
906
907
# File 'ext/ae-rad/ae-rad-libs.rb', line 900

def initialize(_contract, _signature=SIGNATURE, _context=nil)
  @contract = _contract
		@signature = _signature
		@context = _context
		_context.channel != nil ?@channel=_context.channel: @channel='0'
		@time = Time.new
		@action = false
end

Instance Attribute Details

#action=(value) ⇒ Object (writeonly)

Sets the attribute action

Parameters:

  • value

    the value to set the attribute action to.



897
898
899
# File 'ext/ae-rad/ae-rad-libs.rb', line 897

def action=(value)
  @action = value
end

#channelObject (readonly)

Returns the value of attribute channel.



895
896
897
# File 'ext/ae-rad/ae-rad-libs.rb', line 895

def channel
  @channel
end

#contextObject (readonly)

Returns the value of attribute context.



894
895
896
# File 'ext/ae-rad/ae-rad-libs.rb', line 894

def context
  @context
end

#contractObject (readonly)

Returns the value of attribute contract.



892
893
894
# File 'ext/ae-rad/ae-rad-libs.rb', line 892

def contract
  @contract
end

#signatureObject (readonly)

Returns the value of attribute signature.



893
894
895
# File 'ext/ae-rad/ae-rad-libs.rb', line 893

def signature
  @signature
end

#timeObject (readonly)

Returns the value of attribute time.



896
897
898
# File 'ext/ae-rad/ae-rad-libs.rb', line 896

def time
  @time
end

Instance Method Details

#handled(_from) ⇒ Object



909
910
911
# File 'ext/ae-rad/ae-rad-libs.rb', line 909

def handled(_from)
  MainContract.instance.event_handled(_from,'caused_by'=>self)
end

#is_action?Boolean

Returns:

  • (Boolean)


913
914
915
# File 'ext/ae-rad/ae-rad-libs.rb', line 913

def is_action? 
  @action
end