gecko-ruby 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/config/rubocop_linter_action.yml +7 -0
- data/.github/workflows/testing.yml +26 -0
- data/.rubocop.yml +23 -16
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/Rakefile +3 -1
- data/gecko-ruby.gemspec +11 -10
- data/generate.thor +4 -1
- data/lib/gecko-ruby.rb +2 -0
- data/lib/gecko.rb +2 -0
- data/lib/gecko/client.rb +16 -14
- data/lib/gecko/ext/liquid_compat.rb +10 -10
- data/lib/gecko/ext/log_subscriber.rb +6 -6
- data/lib/gecko/helpers/association_helper.rb +11 -9
- data/lib/gecko/helpers/inspection_helper.rb +4 -2
- data/lib/gecko/helpers/record_helper.rb +2 -0
- data/lib/gecko/helpers/serialization_helper.rb +5 -1
- data/lib/gecko/helpers/validation_helper.rb +3 -1
- data/lib/gecko/record/account.rb +3 -1
- data/lib/gecko/record/address.rb +2 -0
- data/lib/gecko/record/base.rb +5 -3
- data/lib/gecko/record/base_adapter.rb +23 -18
- data/lib/gecko/record/company.rb +2 -0
- data/lib/gecko/record/contact.rb +2 -0
- data/lib/gecko/record/currency.rb +2 -0
- data/lib/gecko/record/exceptions.rb +2 -0
- data/lib/gecko/record/fulfillment.rb +2 -0
- data/lib/gecko/record/fulfillment_line_item.rb +2 -1
- data/lib/gecko/record/image.rb +13 -8
- data/lib/gecko/record/invoice.rb +5 -1
- data/lib/gecko/record/invoice_line_item.rb +2 -1
- data/lib/gecko/record/location.rb +2 -0
- data/lib/gecko/record/note.rb +2 -0
- data/lib/gecko/record/order.rb +2 -0
- data/lib/gecko/record/order_line_item.rb +3 -0
- data/lib/gecko/record/payment_term.rb +2 -1
- data/lib/gecko/record/product.rb +4 -0
- data/lib/gecko/record/purchase_order.rb +2 -1
- data/lib/gecko/record/purchase_order_line_item.rb +2 -1
- data/lib/gecko/record/tax_type.rb +2 -1
- data/lib/gecko/record/user.rb +3 -1
- data/lib/gecko/record/variant.rb +9 -7
- data/lib/gecko/record/webhook.rb +3 -1
- data/lib/gecko/version.rb +3 -1
- data/test/client_test.rb +4 -2
- data/test/fixtures/vcr_cassettes/images.yml +1 -1
- data/test/gecko_test.rb +2 -0
- data/test/helpers/association_helper_test.rb +7 -5
- data/test/helpers/inspection_helper_test.rb +6 -4
- data/test/helpers/serialization_helper_test.rb +16 -14
- data/test/helpers/validation_helper_test.rb +3 -1
- data/test/record/account_adapter_test.rb +2 -0
- data/test/record/address_adapter_test.rb +2 -0
- data/test/record/address_test.rb +2 -0
- data/test/record/company_adapter_test.rb +2 -0
- data/test/record/company_test.rb +2 -0
- data/test/record/contact_adapter_test.rb +2 -0
- data/test/record/contact_test.rb +3 -1
- data/test/record/currency_adapter_test.rb +2 -0
- data/test/record/currency_test.rb +2 -0
- data/test/record/fulfillment_adapter_test.rb +2 -0
- data/test/record/fulfillment_line_item_adapter_test.rb +2 -0
- data/test/record/fulfillment_line_item_test.rb +2 -0
- data/test/record/fulfillment_test.rb +4 -2
- data/test/record/image_adapter_test.rb +2 -0
- data/test/record/image_test.rb +18 -0
- data/test/record/invoice_adapter_test.rb +2 -0
- data/test/record/invoice_line_item_adapter_test.rb +2 -0
- data/test/record/invoice_line_item_test.rb +2 -0
- data/test/record/invoice_test.rb +2 -0
- data/test/record/location_adapter_test.rb +2 -0
- data/test/record/location_test.rb +2 -0
- data/test/record/note_test.rb +2 -0
- data/test/record/order_adapter_test.rb +2 -0
- data/test/record/order_line_item_adapter_test.rb +2 -0
- data/test/record/order_line_item_test.rb +2 -0
- data/test/record/order_test.rb +2 -0
- data/test/record/payment_term_adapter_test.rb +2 -0
- data/test/record/payment_term_test.rb +2 -0
- data/test/record/product_adapter_test.rb +2 -0
- data/test/record/product_test.rb +2 -0
- data/test/record/purchase_order_adapter_test.rb +2 -0
- data/test/record/purchase_order_line_item_adapter_test.rb +2 -0
- data/test/record/purchase_order_line_item_test.rb +2 -0
- data/test/record/purchase_order_test.rb +2 -0
- data/test/record/tax_type_adapter_test.rb +2 -0
- data/test/record/tax_type_test.rb +2 -0
- data/test/record/user_adapter_test.rb +2 -0
- data/test/record/user_test.rb +2 -0
- data/test/record/variant_adapter_test.rb +2 -0
- data/test/record/variant_test.rb +6 -4
- data/test/record/webhook_test.rb +2 -0
- data/test/support/let.rb +2 -0
- data/test/support/shared_adapter_examples.rb +34 -30
- data/test/support/shared_record_examples.rb +3 -1
- data/test/support/shared_sideloaded_data_parsing_examples.rb +2 -1
- data/test/support/testing_adapter.rb +2 -0
- data/test/support/vcr_support.rb +2 -0
- data/test/test_helper.rb +2 -0
- metadata +24 -23
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0eb1c65172dc30ba079cc816764f1329d5a2bf1f8835b425b9aebcaee117230f
|
4
|
+
data.tar.gz: c2003acbfe9bc3c7c80497610ae7e4193937d52e7a2e9671f5d9bd38309e8208
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e43314e5da9020c7b7440585205aabd7e37342bd0a25a8c56025c6abf2416e347ed591a3293123c5d1934c929c90e64a14cfe6eaa0f902c188943276db1c9c2
|
7
|
+
data.tar.gz: 1c831c98c2b1cc0cdec7a9fe2ba6c1f70e942eef2b70c201892f124cceee21b2c0ff6d08ea4714119b40d2d0cc1b993258991f92998aac8f066c78924e8e7e9b
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
name: Ruby Tests
|
3
|
+
|
4
|
+
'on': [push, pull_request]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby: ['2.4', '2.5', '2.6', '2.7']
|
12
|
+
name: Ruby ${{ matrix.ruby }}
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: ${{ matrix.ruby }}
|
18
|
+
- name: Run Tests
|
19
|
+
run: |
|
20
|
+
gem install bundler --no-document
|
21
|
+
bundle install --jobs 4 --retry 3
|
22
|
+
bundle exec rake
|
23
|
+
- name: Rubocop
|
24
|
+
uses: andrewmcodes/rubocop-linter-action@v3.1.0
|
25
|
+
env:
|
26
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
AllCops:
|
2
2
|
DisplayCopNames: true
|
3
|
+
Exclude:
|
4
|
+
- 'bin/*'
|
5
|
+
- 'generate.thor'
|
3
6
|
|
4
7
|
# class Example
|
5
8
|
# ...
|
@@ -9,33 +12,34 @@ AllCops:
|
|
9
12
|
Layout/AccessModifierIndentation:
|
10
13
|
EnforcedStyle: outdent
|
11
14
|
|
12
|
-
Style/Blocks:
|
13
|
-
Enabled: false
|
14
|
-
|
15
|
-
# Allows foo(bar: baz)
|
16
|
-
Style/BracesAroundHashParameters:
|
17
|
-
Enabled: false
|
18
|
-
|
19
15
|
Layout/DotPosition:
|
20
16
|
EnforcedStyle: leading
|
21
17
|
|
22
|
-
Layout/
|
18
|
+
Layout/FirstHashElementIndentation:
|
23
19
|
EnforcedStyle: consistent
|
24
20
|
|
25
|
-
|
21
|
+
Layout/LineLength:
|
26
22
|
Max: 120
|
27
23
|
|
28
|
-
|
29
|
-
|
24
|
+
Layout/HashAlignment:
|
25
|
+
EnforcedColonStyle: table
|
30
26
|
|
31
|
-
|
32
|
-
|
27
|
+
Metrics/AbcSize:
|
28
|
+
Exclude:
|
29
|
+
- 'test/**/*.rb'
|
30
|
+
|
31
|
+
Naming/FileName:
|
32
|
+
Exclude:
|
33
|
+
- 'lib/gecko-ruby.rb'
|
34
|
+
|
35
|
+
Naming/PredicateName:
|
33
36
|
Enabled: false
|
34
37
|
|
35
|
-
|
38
|
+
Naming/AccessorMethodName:
|
36
39
|
Enabled: false
|
37
40
|
|
38
|
-
|
41
|
+
# We like neatly-aligned code
|
42
|
+
Layout/SpaceBeforeFirstArg:
|
39
43
|
Enabled: false
|
40
44
|
|
41
45
|
# Allow single or double quotes
|
@@ -63,7 +67,10 @@ Layout/MultilineOperationIndentation:
|
|
63
67
|
Enabled: false
|
64
68
|
|
65
69
|
Style/ClassAndModuleChildren:
|
66
|
-
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
Style/Documentation:
|
73
|
+
Enabled: false
|
67
74
|
|
68
75
|
Style/DoubleNegation:
|
69
76
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# TradeGecko RubyGem
|
1
|
+
# TradeGecko RubyGem ![Build Status](https://github.com/tradegecko/gecko/workflows/Ruby%20Tests/badge.svg) [![Code Climate](https://codeclimate.com/github/tradegecko/gecko.png)](https://codeclimate.com/github/tradegecko/gecko)
|
2
2
|
The official TradeGecko API RubyGem
|
3
3
|
|
4
4
|
## Introduction
|
data/Rakefile
CHANGED
data/gecko-ruby.gemspec
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'gecko/version'
|
5
6
|
|
@@ -8,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
8
9
|
spec.version = Gecko::VERSION
|
9
10
|
spec.authors = ["Bradley Priest"]
|
10
11
|
spec.email = ['bradley@tradegecko.com']
|
11
|
-
spec.description =
|
12
|
+
spec.description = 'A Ruby interface to the TradeGecko API.'
|
12
13
|
spec.summary = spec.description
|
13
14
|
spec.homepage = 'https://github.com/tradegecko/gecko/'
|
14
15
|
spec.license = 'MIT'
|
@@ -19,17 +20,17 @@ Gem::Specification.new do |spec|
|
|
19
20
|
spec.require_paths = ["lib"]
|
20
21
|
|
21
22
|
spec.add_development_dependency "bundler"
|
22
|
-
spec.add_development_dependency "
|
23
|
+
spec.add_development_dependency "dotenv"
|
23
24
|
spec.add_development_dependency "minitest"
|
24
|
-
spec.add_development_dependency "vcr"
|
25
|
-
spec.add_development_dependency "webmock"
|
26
25
|
spec.add_development_dependency "mocha"
|
27
|
-
spec.add_development_dependency "timecop"
|
28
|
-
spec.add_development_dependency "dotenv"
|
29
|
-
spec.add_development_dependency "thor"
|
30
26
|
spec.add_development_dependency "pry"
|
27
|
+
spec.add_development_dependency "rake"
|
28
|
+
spec.add_development_dependency "thor"
|
29
|
+
spec.add_development_dependency "timecop"
|
30
|
+
spec.add_development_dependency "vcr"
|
31
|
+
spec.add_development_dependency "webmock"
|
31
32
|
|
33
|
+
spec.add_dependency "activesupport"
|
32
34
|
spec.add_dependency "oauth2", "> 1.1.0"
|
33
35
|
spec.add_dependency "virtus"
|
34
|
-
spec.add_dependency "activesupport"
|
35
36
|
end
|
data/generate.thor
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/inflector'
|
2
4
|
class Generate < Thor
|
3
5
|
include Thor::Actions
|
@@ -7,7 +9,7 @@ class Generate < Thor
|
|
7
9
|
@model_name = model_name
|
8
10
|
@file_name = model_name.underscore
|
9
11
|
@plural = ask "What is the underscore plural of #{@model_name}? (#{@file_name}s):"
|
10
|
-
@plural =
|
12
|
+
@plural = !@plural.to_s.empty? ? @plural : @file_name + "s"
|
11
13
|
create_file "lib/gecko/record/#{@file_name}.rb", model_template
|
12
14
|
create_file "test/record/#{@file_name}_adapter_test.rb", test_adapter_template
|
13
15
|
create_file "test/record/#{@file_name}_test.rb", test_template
|
@@ -16,6 +18,7 @@ class Generate < Thor
|
|
16
18
|
end
|
17
19
|
|
18
20
|
private
|
21
|
+
|
19
22
|
def default_plural?
|
20
23
|
@plural == @file_name + "s"
|
21
24
|
end
|
data/lib/gecko-ruby.rb
CHANGED
data/lib/gecko.rb
CHANGED
data/lib/gecko/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'faraday'
|
2
4
|
require 'oauth2/version'
|
3
5
|
require 'gecko/version'
|
@@ -57,7 +59,7 @@ module Gecko
|
|
57
59
|
# @return [undefined]
|
58
60
|
#
|
59
61
|
# @api private
|
60
|
-
def initialize(client_id, client_secret, options={})
|
62
|
+
def initialize(client_id, client_secret, options = {})
|
61
63
|
setup_oauth_client(client_id, client_secret, options)
|
62
64
|
end
|
63
65
|
|
@@ -107,29 +109,29 @@ module Gecko
|
|
107
109
|
#
|
108
110
|
# @api private
|
109
111
|
def adapter_for(klass_name)
|
110
|
-
|
112
|
+
public_send(klass_name.to_sym)
|
113
|
+
end
|
114
|
+
|
115
|
+
def self.default_headers
|
116
|
+
{
|
117
|
+
'User-Agent' => ["Gecko/#{Gecko::VERSION}",
|
118
|
+
"OAuth2/#{OAuth2::Version}",
|
119
|
+
"Faraday/#{Faraday::VERSION}",
|
120
|
+
"Ruby/#{RUBY_VERSION}"].join(' ')
|
121
|
+
}
|
111
122
|
end
|
112
123
|
|
113
124
|
private
|
114
125
|
|
115
126
|
def setup_oauth_client(client_id, client_secret, options)
|
116
127
|
defaults = {
|
117
|
-
site:
|
118
|
-
authorize_url:
|
128
|
+
site: 'https://api.tradegecko.com',
|
129
|
+
authorize_url: 'https://go.tradegecko.com/oauth/authorize',
|
119
130
|
connection_opts: {
|
120
|
-
headers:
|
131
|
+
headers: self.class.default_headers
|
121
132
|
}
|
122
133
|
}
|
123
134
|
@oauth_client = OAuth2::Client.new(client_id, client_secret, defaults.merge(options))
|
124
135
|
end
|
125
|
-
|
126
|
-
def self.default_headers
|
127
|
-
{
|
128
|
-
'User-Agent' => ["Gecko/#{Gecko::VERSION}",
|
129
|
-
"OAuth2/#{OAuth2::Version.to_s}",
|
130
|
-
"Faraday/#{Faraday::VERSION}",
|
131
|
-
"Ruby/#{RUBY_VERSION}"].join(' ')
|
132
|
-
}
|
133
|
-
end
|
134
136
|
end
|
135
137
|
end
|
@@ -56,20 +56,20 @@ module Gecko
|
|
56
56
|
|
57
57
|
## Override Liquid::Drop#invoke_drop to also check method arity
|
58
58
|
def invoke_drop(method_or_key)
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
return unless invokable_methods.include?(method_or_key.to_s) && method_arity(method_or_key.to_sym) <= 0
|
60
|
+
|
61
|
+
public_send(method_or_key)
|
62
62
|
end
|
63
63
|
|
64
|
-
|
64
|
+
alias [] invoke_drop
|
65
65
|
|
66
66
|
## Override Liquid::Drop#invokable_methods to add extra checks
|
67
67
|
def invokable_methods
|
68
68
|
@invokable_methods ||= begin
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
available_methods = (
|
69
|
+
denylist = Gecko::Record::Base.public_instance_methods + Liquid::Drop.public_instance_methods
|
70
|
+
denylist -= %i[to_liquid id created_at updated_at]
|
71
|
+
allowlist = public_methods + @delegate.public_methods
|
72
|
+
available_methods = (allowlist - denylist).map(&:to_s)
|
73
73
|
available_methods.reject! { |method_name| method_name.ends_with?("=") }
|
74
74
|
Set.new(available_methods)
|
75
75
|
end
|
@@ -78,8 +78,8 @@ module Gecko
|
|
78
78
|
protected
|
79
79
|
|
80
80
|
def method_arity(method_name)
|
81
|
-
if
|
82
|
-
|
81
|
+
if methods.include?(method_name)
|
82
|
+
method(method_name).arity
|
83
83
|
else
|
84
84
|
@delegate.method(method_name).arity
|
85
85
|
end
|
@@ -13,7 +13,7 @@ class GeckoLogSubscriber < ActiveSupport::LogSubscriber
|
|
13
13
|
@odd = false
|
14
14
|
end
|
15
15
|
|
16
|
-
def request(event)
|
16
|
+
def request(event) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
17
17
|
RequestStore.store[ENV_KEY] = []
|
18
18
|
payload = event.payload
|
19
19
|
|
@@ -27,11 +27,11 @@ class GeckoLogSubscriber < ActiveSupport::LogSubscriber
|
|
27
27
|
name = "#{payload[:model_class]} Load (#{event.duration.round(1)}ms)"
|
28
28
|
query = "#{payload[:verb].to_s.upcase} /#{request_path}"
|
29
29
|
|
30
|
-
if odd?
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
name = if odd?
|
31
|
+
color(name, CYAN, true)
|
32
|
+
else
|
33
|
+
color(name, MAGENTA, true)
|
34
|
+
end
|
35
35
|
|
36
36
|
query = color(query, nil, true)
|
37
37
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gecko
|
2
4
|
module Helpers
|
3
5
|
# Helper for has_many/belongs_to relationships
|
@@ -24,7 +26,7 @@ module Gecko
|
|
24
26
|
# @return [undefined]
|
25
27
|
#
|
26
28
|
# @api public
|
27
|
-
def belongs_to(model_name, options={})
|
29
|
+
def belongs_to(model_name, options = {})
|
28
30
|
class_name = options[:class_name] || model_name.to_s.classify
|
29
31
|
foreign_key = model_name.to_s.foreign_key.to_sym
|
30
32
|
|
@@ -55,20 +57,20 @@ module Gecko
|
|
55
57
|
# @return [undefined]
|
56
58
|
#
|
57
59
|
# @api public
|
58
|
-
def has_many(association_name, options={})
|
60
|
+
def has_many(association_name, options = {}) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
59
61
|
model_name = association_name.to_s.singularize
|
60
62
|
class_name = options[:class_name] || model_name.classify
|
61
63
|
foreign_key = model_name.foreign_key.pluralize.to_sym
|
62
64
|
readonly = options.key?(:readonly) ? options[:readonly] : true
|
63
65
|
|
64
|
-
define_method association_name do
|
66
|
+
define_method association_name do # rubocop:disable Metrics/MethodLength
|
65
67
|
collection_proxies[association_name] ||= begin
|
66
|
-
ids =
|
67
|
-
if ids.any?
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
ids = attributes[foreign_key]
|
69
|
+
collection = if ids.any?
|
70
|
+
@client.adapter_for(class_name).find_many(ids)
|
71
|
+
else
|
72
|
+
[]
|
73
|
+
end
|
72
74
|
|
73
75
|
build_collection_proxy(collection, {
|
74
76
|
embedded: options[:embedded],
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gecko
|
2
4
|
module Helpers
|
3
5
|
# Helper for providing custom #inspect values to Records
|
@@ -39,9 +41,9 @@ module Gecko
|
|
39
41
|
if value.is_a?(String) && value.length > 50
|
40
42
|
"#{value[0..50]}...".inspect
|
41
43
|
elsif value.is_a?(DateTime) || value.is_a?(Time)
|
42
|
-
%("#{value.strftime(
|
44
|
+
%("#{value.strftime('%Y-%m-%d %H:%M:%S')}")
|
43
45
|
elsif value.is_a?(Date)
|
44
|
-
%("#{value.strftime(
|
46
|
+
%("#{value.strftime('%Y-%m-%d')}")
|
45
47
|
else
|
46
48
|
value.inspect
|
47
49
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gecko
|
2
4
|
module Helpers
|
3
5
|
# Provides serialization to records
|
@@ -28,6 +30,7 @@ module Gecko
|
|
28
30
|
attribute_hash = {}
|
29
31
|
attribute_set.each do |attribute|
|
30
32
|
next unless writeable?(attribute)
|
33
|
+
|
31
34
|
serialize_attribute(attribute_hash, attribute)
|
32
35
|
end
|
33
36
|
|
@@ -46,6 +49,7 @@ module Gecko
|
|
46
49
|
def writeable?(attribute)
|
47
50
|
return if attribute.options[:readonly]
|
48
51
|
return true unless attribute.options[:writeable_on]
|
52
|
+
|
49
53
|
case attribute.options[:writeable_on]
|
50
54
|
when :update
|
51
55
|
persisted?
|
@@ -75,7 +79,7 @@ module Gecko
|
|
75
79
|
# @return [String]
|
76
80
|
#
|
77
81
|
# @api private
|
78
|
-
def _serialize(serialized)
|
82
|
+
def _serialize(serialized) # rubocop:disable Metrics/MethodLength
|
79
83
|
if serialized.respond_to?(:serializable_hash)
|
80
84
|
serialized.serializable_hash
|
81
85
|
else
|