Class: UU::OS::VUC::Event

Inherits:
Object
  • Object
show all
Defined in:
uu_adk-0.28.16/lib/uu/os/vuc/event.rb

Overview

Form event object.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Event) initialize(data = nil)

Creates new instance of event.

Parameters:

  • data (String, Hash) (defaults to: nil)

    Initialization data in form of JSON string or Hash (optional)



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'uu_adk-0.28.16/lib/uu/os/vuc/event.rb', line 37

def initialize(data = nil)
  if data.nil?
    @raw_attrs = {}
    return
  end
  if data.kind_of?String
    data = JSON.parse(data, :symbolize_names => true)
  end
  if data.kind_of?Hash
    @raw_attrs = data
  elsif data.kind_of?Event
    if data.raw_attrs
      @raw_attrs = data.raw_attrs
    else
      @raw_attrs = {}
    end
  else
    raise ArgumentError.new("Event data must be JSON String or Hash, but was #{data.class}.")
  end
end

Instance Attribute Details

- (String) code (readonly)

Event code.

Returns:

  • (String)


20
21
22
# File 'uu_adk-0.28.16/lib/uu/os/vuc/event.rb', line 20

def code
  @code
end

- (String) form (readonly)

ID of form which event belongs to.

Returns:

  • (String)


32
33
34
# File 'uu_adk-0.28.16/lib/uu/os/vuc/event.rb', line 32

def form
  @form
end

- (String) id (readonly)

Unique event ID.

Returns:

  • (String)


16
17
18
# File 'uu_adk-0.28.16/lib/uu/os/vuc/event.rb', line 16

def id
  @id
end

- (String) source_id (readonly)

ID of component which invoked event.

Returns:

  • (String)


24
25
26
# File 'uu_adk-0.28.16/lib/uu/os/vuc/event.rb', line 24

def source_id
  @source_id
end

- (String) source_uri (readonly)

URI of object which invoked event (e.g. process URI).

Returns:

  • (String)


28
29
30
# File 'uu_adk-0.28.16/lib/uu/os/vuc/event.rb', line 28

def source_uri
  @source_uri
end