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.



892
893
894
895
896
897
898
899
# File 'ext/ae-rad/ae-rad-libs.rb', line 892

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.



889
890
891
# File 'ext/ae-rad/ae-rad-libs.rb', line 889

def action=(value)
  @action = value
end

#channelObject (readonly)

Returns the value of attribute channel.



887
888
889
# File 'ext/ae-rad/ae-rad-libs.rb', line 887

def channel
  @channel
end

#contextObject (readonly)

Returns the value of attribute context.



886
887
888
# File 'ext/ae-rad/ae-rad-libs.rb', line 886

def context
  @context
end

#contractObject (readonly)

Returns the value of attribute contract.



884
885
886
# File 'ext/ae-rad/ae-rad-libs.rb', line 884

def contract
  @contract
end

#signatureObject (readonly)

Returns the value of attribute signature.



885
886
887
# File 'ext/ae-rad/ae-rad-libs.rb', line 885

def signature
  @signature
end

#timeObject (readonly)

Returns the value of attribute time.



888
889
890
# File 'ext/ae-rad/ae-rad-libs.rb', line 888

def time
  @time
end

Instance Method Details

#handled(_from) ⇒ Object



901
902
903
# File 'ext/ae-rad/ae-rad-libs.rb', line 901

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

#is_action?Boolean

Returns:

  • (Boolean)


905
906
907
# File 'ext/ae-rad/ae-rad-libs.rb', line 905

def is_action? 
  @action
end