capsule_crm 1.6.2 → 1.7.0

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: e63af1aeb254c386c75f71887655f99499fb4738
4
- data.tar.gz: d686a04491edd661dc7595611fd78a2b906f4687
3
+ metadata.gz: 935d3018b76a8144d83756b5aef8fc9efbe25878
4
+ data.tar.gz: d7565a3704e3884b189ef8491198e7a42fac703c
5
5
  SHA512:
6
- metadata.gz: 9738614f297ebd8b9d293c1a1e2be92f03d4ed254780497eaf89e38ee6832d8f3947b3c5dd203833f41a1fe99ade6f4f968b43f1e581ceada44f2aae97e8d82f
7
- data.tar.gz: 78eb9bd924102eb42dfbae78262d51a5c28c45444465020e4cf8ef0396aab6c23fc3e99d9ef7381678b2069b4a489dc13452e90e6cfe54571ef117e1a736fafa
6
+ metadata.gz: 9678e359e403045ebbc4225639ecd8c6da8b1e136be2d5af2b0424a82405f391617c702d53ab91a0c303f913d8c5dea96064303a5e2ef2dbf37a2e65019715f9
7
+ data.tar.gz: b441b111feb03a3daac3f0439b815bdf6139b15403db004aa857c4cfd126d497bf26dbde1a293e310a4bfdeca86991b9ee4c0aadf8d0bd2373408a4e5d1efb4f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.0
4
+
5
+ - Inspecting items only displays their attributes now. Much cleaner for working
6
+ on the console
7
+
3
8
  ## 1.6.2
4
9
 
5
10
  - Fix bug where responses errors always had a blank body
@@ -1,6 +1,7 @@
1
1
  module CapsuleCRM
2
2
  class Address
3
3
  include Virtus.model
4
+ include CapsuleCRM::Inspector
4
5
  include CapsuleCRM::Serializable
5
6
  extend ActiveModel::Naming
6
7
 
@@ -3,6 +3,7 @@ module CapsuleCRM
3
3
  include Virtus.model
4
4
 
5
5
  include ActiveModel::Validations
6
+ include CapsuleCRM::Inspector
6
7
 
7
8
  attribute :id, Integer
8
9
  attribute :filename, String
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Persistence::Persistable
11
12
  include CapsuleCRM::Persistence::Deletable
12
13
  include CapsuleCRM::Querying::Findable
@@ -2,9 +2,10 @@ module CapsuleCRM
2
2
  class Country
3
3
  include Virtus.model
4
4
 
5
- include CapsuleCRM::Serializable
5
+ include CapsuleCRM::Inspector
6
6
  include CapsuleCRM::Querying::Configuration
7
7
  include CapsuleCRM::Querying::FindAll
8
+ include CapsuleCRM::Serializable
8
9
 
9
10
  serializable_config do |config|
10
11
  config.attribute_to_assign = :name
@@ -6,6 +6,7 @@ module CapsuleCRM
6
6
  include ActiveModel::Conversion
7
7
  include ActiveModel::Validations
8
8
 
9
+ include CapsuleCRM::Inspector
9
10
  include CapsuleCRM::Querying::Configuration
10
11
  include CapsuleCRM::Querying::FindAll
11
12
  include CapsuleCRM::Serializable
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Querying::Configuration
11
12
  include CapsuleCRM::Serializable
12
13
 
@@ -1,7 +1,10 @@
1
1
  module CapsuleCRM
2
2
  class Email
3
3
  include Virtus.model
4
+
5
+ include CapsuleCRM::Inspector
4
6
  include CapsuleCRM::Serializable
7
+
5
8
  extend ActiveModel::Naming
6
9
 
7
10
  serializable_config do |config|
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Persistence::Persistable
11
12
  include CapsuleCRM::Persistence::Deletable
12
13
  include CapsuleCRM::Querying::Configuration
@@ -0,0 +1,11 @@
1
+ module CapsuleCRM
2
+ module Inspector
3
+ def inspect
4
+ string = "#<#{self.class.name}:#{self.object_id} "
5
+ fields = self.class.attribute_set.map do |field|
6
+ "#{field.name}: #{self.send(field.name)}"
7
+ end
8
+ string << fields.join(", ") << ">"
9
+ end
10
+ end
11
+ end
@@ -3,6 +3,7 @@ module CapsuleCRM
3
3
  include ActiveModel::Validations
4
4
  include Virtus.model
5
5
 
6
+ include CapsuleCRM::Inspector
6
7
  include CapsuleCRM::Querying::Configuration
7
8
  include CapsuleCRM::Querying::FindAll
8
9
  include CapsuleCRM::Serializable
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Querying::Findable
11
12
  include CapsuleCRM::Persistence::Persistable
12
13
  include CapsuleCRM::Persistence::Deletable
@@ -6,6 +6,8 @@ module CapsuleCRM
6
6
  include ActiveModel::Validations
7
7
  include ActiveModel::Conversion
8
8
 
9
+ include CapsuleCRM::Inspector
10
+
9
11
  attribute :name, String
10
12
  attribute :email_address, String
11
13
  attribute :role, String
@@ -2,6 +2,7 @@ class CapsuleCRM::Party
2
2
  include Virtus.model
3
3
 
4
4
  include CapsuleCRM::Associations
5
+ include CapsuleCRM::Inspector
5
6
  include CapsuleCRM::Querying::Findable
6
7
  include CapsuleCRM::Serializable
7
8
  include CapsuleCRM::Taggable
@@ -19,6 +20,7 @@ class CapsuleCRM::Party
19
20
  has_many :custom_fields, embedded: true
20
21
  has_many :cases
21
22
 
23
+
22
24
  private
23
25
 
24
26
  def self.child_classes
@@ -1,9 +1,11 @@
1
1
  module CapsuleCRM
2
2
  class Phone
3
3
  include Virtus.model
4
- include CapsuleCRM::Serializable
5
4
  extend ActiveModel::Naming
6
5
 
6
+ include CapsuleCRM::Inspector
7
+ include CapsuleCRM::Serializable
8
+
7
9
  serializable_config do |config|
8
10
  config.include_root = false
9
11
  config.exclude_id = false
@@ -6,6 +6,8 @@ module CapsuleCRM
6
6
  include ActiveModel::Conversion
7
7
  include ActiveModel::Validations
8
8
 
9
+ include CapsuleCRM::Inspector
10
+
9
11
  attribute :name
10
12
 
11
13
  validates :name, presence: true
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Persistence::Persistable
11
12
  include CapsuleCRM::Persistence::Deletable
12
13
  include CapsuleCRM::Querying::Findable
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Querying::Configuration
11
12
  include CapsuleCRM::Querying::FindAll
12
13
  include CapsuleCRM::Serializable
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Querying::Configuration
11
12
  include CapsuleCRM::Querying::FindAll
12
13
  include CapsuleCRM::Serializable
@@ -7,6 +7,7 @@ module CapsuleCRM
7
7
  include ActiveModel::Validations
8
8
 
9
9
  include CapsuleCRM::Associations
10
+ include CapsuleCRM::Inspector
10
11
  include CapsuleCRM::Querying::Configuration
11
12
  include CapsuleCRM::Querying::FindAll
12
13
  include CapsuleCRM::Serializable
@@ -1,3 +1,3 @@
1
1
  module CapsuleCrm
2
- VERSION = '1.6.2'
2
+ VERSION = '1.7.0'
3
3
  end
@@ -1,11 +1,13 @@
1
1
  module CapsuleCRM
2
2
  class Website
3
3
  include Virtus.model
4
- include CapsuleCRM::Serializable
5
4
 
6
5
  extend ActiveModel::Naming
7
6
  include ActiveModel::Validations
8
7
 
8
+ include CapsuleCRM::Inspector
9
+ include CapsuleCRM::Serializable
10
+
9
11
  serializable_config do |config|
10
12
  config.include_root = false
11
13
  config.exclude_id = false
data/lib/capsule_crm.rb CHANGED
@@ -12,6 +12,7 @@ require 'capsule_crm/persistence'
12
12
  require 'capsule_crm/querying'
13
13
  require 'capsule_crm/serializer'
14
14
  require 'capsule_crm/serializable'
15
+ require 'capsule_crm/inspector'
15
16
 
16
17
  require 'capsule_crm/address'
17
18
  require 'capsule_crm/attachment'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capsule_crm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Beedle
@@ -281,6 +281,7 @@ files:
281
281
  - lib/capsule_crm/gettable.rb
282
282
  - lib/capsule_crm/hash_helper.rb
283
283
  - lib/capsule_crm/history.rb
284
+ - lib/capsule_crm/inspector.rb
284
285
  - lib/capsule_crm/milestone.rb
285
286
  - lib/capsule_crm/normalizer.rb
286
287
  - lib/capsule_crm/opportunity.rb