action_kit_api 0.3.1 → 0.3.2

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.
@@ -11,8 +11,7 @@ module ActionKitApi
11
11
  def initialize(hash = {})
12
12
  @required_attrs ||= []
13
13
  @read_only_attrs ||= []
14
- @read_only_attrs << :created_at
15
- @read_only_attrs << :updated_at
14
+ @read_only_attrs << :created_at << :updated_at
16
15
 
17
16
  self.update(hash)
18
17
  end
@@ -62,7 +61,10 @@ module ActionKitApi
62
61
  user_hash = {}
63
62
 
64
63
  self.instance_variables.each do |iv|
65
- key = iv.delete("@").to_sym
64
+ if iv.is_a? String
65
+ key = iv.delete("@").to_sym
66
+ end
67
+
66
68
  next if key == :required_attrs
67
69
  next if key == :read_only_attrs
68
70
  user_hash[key] = self.instance_variable_get(iv)
@@ -17,7 +17,7 @@ module ActionKitApi
17
17
 
18
18
  def initialize(*args)
19
19
  @required_attrs = [:campaign, :creator, :title]
20
- @read_only_attrs =[:attendee_count]
20
+ @read_only_attrs = [:attendee_count]
21
21
 
22
22
  super
23
23
  end
@@ -25,8 +25,8 @@ module ActionKitApi
25
25
  def cancel
26
26
  raise "Can't cancel unsaved Event" if self.id.nil?
27
27
 
28
- status "cancelled"
29
- save
28
+ self.status = "cancelled"
29
+ self.save
30
30
  end
31
31
  end
32
32
  end
@@ -30,6 +30,7 @@ module ActionKitApi
30
30
  raise "EventCampaign needs to be saved before Event creation" if self.id.nil?
31
31
 
32
32
  args[0][:campaign] = self.id
33
+
33
34
  Event.new(args)
34
35
  end
35
36
 
@@ -1,3 +1,3 @@
1
1
  module ActionKitApi
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sam Stelfox