whenhub 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0f343e2acd32d7e7eb9f0a38786ad1cc58f5c80
4
- data.tar.gz: f56a305ec39851f53e67125d04f44c0c3cef0493
3
+ metadata.gz: 89070de6944d3cc986d02fffb71327863c16b14f
4
+ data.tar.gz: 117900123549168e6462793db78459253b2b85a2
5
5
  SHA512:
6
- metadata.gz: cf12852146574cb66eb29e4817a0538aadd6a296b5e23541aced46d13b7770697b03a1b88b49175210311c59dbf194542d5fa8a31c11c5949e8e0d83c8906274
7
- data.tar.gz: 4deb730636fa9967524a2c75ebd155b310cba9111043472d3b0e7c20f17f21b463c231ea4da0b4ebc31f7ffc7fb356a442c466e5aec06bd8161026cd28f65b32
6
+ metadata.gz: acbd2e6d8571fc6a3cbcd0efb5436e27b5749167e8be9d5f4f8d8db1c2852944bddcfe72ff03ef07041aee2a2fdebc98cefebb0a05d7b7afd91de43ff7ada622
7
+ data.tar.gz: a3cca8652df092f77312fc3322aac93a509591a934e49cc6618f38a0c39f5904843775e98d07fd8ac62e8b0532c1aa5ce744b13e45fd935764c835d4f8899227
@@ -1,27 +1,12 @@
1
- require 'virtus'
1
+ require 'active_model'
2
2
 
3
3
  module WhenHub
4
4
  class Event
5
- include Virtus.model
5
+ include ActiveModel::Model
6
6
 
7
- attribute :when, Hash
8
- attribute :name, String
9
- attribute :description, String
10
- attribute :icon, String
11
- attribute :location, Hash
12
- attribute :resources, Array
13
- attribute :priority, String
14
- attribute :draft, Boolean
15
- attribute :tags, Array
16
- attribute :order, Integer
17
- attribute :customFieldData, Hash
18
- attribute :id, String
19
- attribute :userId, String
20
- attribute :createdAt, Time
21
- attribute :updatedAt, Time
22
- attribute :createdBy, String
23
- attribute :updatedBy, String
24
- attribute :scheduleId, String
7
+ attr_accessor :when, :name, :description, :icon, :location, :resources,
8
+ :priority, :draft, :tags, :order, :customFieldData, :id, :userId,
9
+ :createdAt, :updatedAt, :createdBy, :updatedBy, :scheduleId
25
10
 
26
11
  attr_accessor :client
27
12
 
@@ -33,10 +18,12 @@ module WhenHub
33
18
  end
34
19
 
35
20
  def save
36
- self.attributes = @client.post(
37
- "/api/users/me/schedules/#{scheduleId}/events",
38
- writeable_attributes
39
- ).first
21
+ assign_attributes(
22
+ @client.post(
23
+ "/api/users/me/schedules/#{scheduleId}/events",
24
+ writeable_attributes
25
+ ).first
26
+ )
40
27
  end
41
28
 
42
29
  def writeable_attributes
@@ -1,22 +1,11 @@
1
- require 'virtus'
1
+ require 'active_model'
2
2
 
3
3
  module WhenHub
4
4
  class Schedule
5
- include Virtus.model
6
-
7
- attribute :calendar, Hash
8
- attribute :name, String
9
- attribute :description, String
10
- attribute :curator, String
11
- attribute :scope, String
12
- attribute :viewCode, String
13
- attribute :tags, Array
14
- attribute :id, String
15
- attribute :userId, String
16
- attribute :createdAt, Time
17
- attribute :updatedAt, Time
18
- attribute :createdBy, String
19
- attribute :updatedBy, String
5
+ include ActiveModel::Model
6
+
7
+ attr_accessor :calendar, :name, :description, :curator, :scope, :viewCode,
8
+ :tags, :id, :userId, :createdAt, :updatedAt, :createdBy, :updatedBy
20
9
 
21
10
  attr_accessor :client
22
11
 
@@ -27,9 +16,11 @@ module WhenHub
27
16
  end
28
17
 
29
18
  def save
30
- self.attributes = @client.post(
31
- '/api/users/me/schedules',
32
- writeable_attributes
19
+ assign_attributes(
20
+ @client.post(
21
+ '/api/users/me/schedules',
22
+ writeable_attributes
23
+ )
33
24
  )
34
25
  end
35
26
 
@@ -1,18 +1,11 @@
1
- require 'virtus'
1
+ require 'active_model'
2
2
 
3
3
  module WhenHub
4
4
  class User
5
- include Virtus.model
5
+ include ActiveModel::Model
6
6
 
7
- attribute :displayName, String
8
- attribute :photo, String
9
- attribute :login, Time
10
- attribute :twoFactor, Boolean
11
- attribute :username, String
12
- attribute :id, String
13
- attribute :createdAt, Time
14
- attribute :updatedAt, Time
15
- attribute :schedulesFollowed, Array
7
+ attr_accessor :name, :displayName, :photo, :login, :twoFactor, :username,
8
+ :id, :createdAt, :updatedAt, :schedulesFollowed
16
9
 
17
10
  attr_accessor :client
18
11
 
@@ -1,3 +1,3 @@
1
1
  module WhenHub
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -21,9 +21,10 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_dependency 'rest-client'
24
- spec.add_dependency 'virtus'
24
+ spec.add_dependency 'activemodel'
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.14"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
+ spec.add_development_dependency 'pry'
29
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whenhub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Gillooly
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: virtus
28
+ name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pry
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: a gem for the WhenHub API
84
98
  email:
85
99
  - git@mattgillooly.com