nilclass-onfire 0.1.1.nc → 0.1.2.nc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/onfire/event.rb CHANGED
@@ -2,24 +2,24 @@ module Onfire
2
2
  # An Event is born in #fire and is passed up the ancestor chain of the triggering datastructure.
3
3
  # It carries a <tt>type</tt>, the fireing widget <tt>source</tt> and arbitrary payload <tt>data</tt>.
4
4
  class Event
5
-
5
+
6
6
  attr_accessor :type, :source, :data
7
-
7
+
8
8
  def initialize(type=nil, source=nil, data=nil)
9
9
  @type = type
10
10
  @source = source
11
11
  @data = data
12
12
  end
13
-
13
+
14
14
  def stopped?
15
15
  @stopped ||= false
16
16
  end
17
-
17
+
18
18
  # Stop event bubbling.
19
19
  def stop!
20
20
  @stopped = true
21
21
  end
22
-
22
+
23
23
  ### FIXME: what about serialization? should we simply forget the source?
24
24
  def _dump(depth)
25
25
  ""
@@ -27,5 +27,9 @@ module Onfire
27
27
  def self._load(str)
28
28
  ::Onfire::Event.new
29
29
  end
30
+
31
+ def to_s
32
+ "#<Onfire::Event:0x#{object_id.to_s(16)} type: #{type} source:#{source} data: #{data}>"
33
+ end ; alias :to_s :inspect
30
34
  end
31
35
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Onfire
4
- VERSION = '0.1.1.nc'.freeze
4
+ VERSION = '0.1.2.nc'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nilclass-onfire
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7441426
4
+ hash: 7441438
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
9
+ - 2
10
10
  - nc
11
- version: 0.1.1.nc
11
+ version: 0.1.2.nc
12
12
  platform: ruby
13
13
  authors:
14
14
  - Nick Sutterer