Class: PrePlay::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/preplay/event.rb,
lib/preplay/event/version.rb

Defined Under Namespace

Classes: Configuration

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



24
25
26
# File 'lib/preplay/event.rb', line 24

def context
  @context
end

#dataObject

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



24
25
26
# File 'lib/preplay/event.rb', line 24

def data
  @data
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



24
25
26
# File 'lib/preplay/event.rb', line 24

def 
  @metadata
end

Class Method Details

.configuration(&block) ⇒ Object



39
40
41
# File 'lib/preplay/event.rb', line 39

def self.configuration(&block)
  @@configuration ||= Configuration.new(&block)
end

.configure(&block) ⇒ Object



35
36
37
# File 'lib/preplay/event.rb', line 35

def self.configure(&block)
  configuration(&block)
end

Instance Method Details

#to_scrolls(opts = nil) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/preplay/event.rb', line 45

def to_scrolls(opts = nil)
  event = {
    'd' => data,
    'c' => context,
    'm' => 
  }
  flatten_keys(event).merge!(preplay_event: true)
end