Class: ArcadiaContract::ContractEvent
- Inherits:
-
Object
- Object
- ArcadiaContract::ContractEvent
- Defined in:
- ext/ae-rad/ae-rad-libs.rb
Constant Summary collapse
- SIGNATURE =
"NOT_DEFINED"
Instance Attribute Summary collapse
-
#action ⇒ Object
writeonly
Sets the attribute action.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#contract ⇒ Object
readonly
Returns the value of attribute contract.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #handled(_from) ⇒ Object
-
#initialize(_contract, _signature = SIGNATURE, _context = nil) ⇒ ContractEvent
constructor
A new instance of ContractEvent.
- #is_action? ⇒ Boolean
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
897 898 899 |
# File 'ext/ae-rad/ae-rad-libs.rb', line 897 def action=(value) @action = value end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
895 896 897 |
# File 'ext/ae-rad/ae-rad-libs.rb', line 895 def channel @channel end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
894 895 896 |
# File 'ext/ae-rad/ae-rad-libs.rb', line 894 def context @context end |
#contract ⇒ Object (readonly)
Returns the value of attribute contract.
892 893 894 |
# File 'ext/ae-rad/ae-rad-libs.rb', line 892 def contract @contract end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
893 894 895 |
# File 'ext/ae-rad/ae-rad-libs.rb', line 893 def signature @signature end |
#time ⇒ Object (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
913 914 915 |
# File 'ext/ae-rad/ae-rad-libs.rb', line 913 def is_action? @action end |