scriber 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -11,20 +11,16 @@ module Scriber
11
11
  rescue UnknownRecord
12
12
  end
13
13
  end
14
-
15
- validates_presence_of :klass, :type, :data
14
+
15
+ attributes :klass, :type, :data
16
+ validates_presence_of :klass, :type
16
17
 
17
18
  def play
18
- klass.scribe_play(type, data)
19
+ klass.constantize.scribe_play(type, data)
19
20
  end
20
21
 
21
22
  def klass=(klass)
22
- if klass.is_a?(String)
23
- klass = klass.constantize
24
- end
25
- write_attribute(:klass, klass)
26
- rescue NameError
27
- write_attribute(:klass, nil)
23
+ write_attribute(:klass, klass.to_s)
28
24
  end
29
25
  end
30
26
  end
data/lib/scriber.rb CHANGED
@@ -7,19 +7,8 @@ require "supermodel"
7
7
 
8
8
  module Scriber
9
9
  class ScriberError < StandardError; end
10
-
11
- def disabled?
12
- @disabled
13
- end
14
-
15
- def disable(&block)
16
- @disabled = true
17
- yield
18
- @disabled = false
19
- end
20
10
 
21
- def record(klass, type, data)
22
- return if disabled?
11
+ def record(klass, type, data = nil)
23
12
  Scribe.create({
24
13
  :klass => klass,
25
14
  :type => type,
data/scriber.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{scriber}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alex MacCaw"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scriber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex MacCaw