ynab 3.9.0 → 5.0.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 +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -2
- data/README.md +47 -39
- data/Rakefile +3 -3
- data/docs/Account.md +3 -3
- data/docs/AccountsApi.md +12 -12
- data/docs/CategoriesApi.md +89 -25
- data/docs/Category.md +4 -3
- data/docs/CategoryGroupWithCategories.md +1 -1
- data/docs/ExistingCategory.md +12 -0
- data/docs/MoneyMovement.md +16 -0
- data/docs/MoneyMovementGroup.md +12 -0
- data/docs/MoneyMovementGroupsResponse.md +8 -0
- data/docs/MoneyMovementGroupsResponseData.md +9 -0
- data/docs/MoneyMovementsApi.md +89 -0
- data/docs/{BudgetSettingsResponse.md → MoneyMovementsResponse.md} +2 -2
- data/docs/MoneyMovementsResponseData.md +9 -0
- data/docs/MonthDetail.md +2 -2
- data/docs/MonthSummary.md +1 -1
- data/docs/MonthsApi.md +13 -13
- data/docs/NewCategory.md +12 -0
- data/docs/PatchCategoryGroupWrapper.md +8 -0
- data/docs/PatchCategoryWrapper.md +1 -1
- data/docs/PayeeLocationsApi.md +12 -12
- data/docs/PayeesApi.md +11 -11
- data/docs/{BudgetDetail.md → PlanDetail.md} +4 -4
- data/docs/PlanDetailResponse.md +8 -0
- data/docs/{BudgetDetailResponseData.md → PlanDetailResponseData.md} +2 -2
- data/docs/{BudgetSettings.md → PlanSettings.md} +1 -1
- data/docs/{BudgetDetailResponse.md → PlanSettingsResponse.md} +2 -2
- data/docs/PlanSettingsResponseData.md +8 -0
- data/docs/PlanSummary.md +15 -0
- data/docs/PlanSummaryResponse.md +8 -0
- data/docs/PlanSummaryResponseData.md +9 -0
- data/docs/PlansApi.md +68 -0
- data/docs/PostCategoryGroupWrapper.md +8 -0
- data/docs/PostCategoryWrapper.md +8 -0
- data/docs/SaveCategory.md +2 -1
- data/docs/SaveCategoryGroup.md +8 -0
- data/docs/SaveCategoryGroupResponse.md +8 -0
- data/docs/SaveCategoryGroupResponseData.md +9 -0
- data/docs/SaveMonthCategory.md +1 -1
- data/docs/ScheduledTransactionsApi.md +20 -20
- data/docs/TransactionsApi.md +48 -48
- data/docs/UserApi.md +2 -2
- data/examples/category-balance.rb +2 -2
- data/examples/create-multiple-transactions.rb +2 -2
- data/examples/create-transaction.rb +2 -2
- data/examples/{budget-list.rb → plan-list.rb} +6 -6
- data/examples/{budget-month.rb → plan-month.rb} +9 -10
- data/examples/update-category-budgeted.rb +2 -2
- data/examples/update-multiple-transactions.rb +3 -3
- data/lib/ynab/api/accounts_api.rb +33 -34
- data/lib/ynab/api/categories_api.rb +293 -66
- data/lib/ynab/api/deprecated_api.rb +11 -11
- data/lib/ynab/api/money_movements_api.rb +282 -0
- data/lib/ynab/api/months_api.rb +35 -36
- data/lib/ynab/api/payee_locations_api.rb +33 -34
- data/lib/ynab/api/payees_api.rb +31 -32
- data/lib/ynab/api/{budgets_api.rb → plans_api.rb} +55 -56
- data/lib/ynab/api/scheduled_transactions_api.rb +55 -56
- data/lib/ynab/api/transactions_api.rb +130 -131
- data/lib/ynab/api/user_api.rb +2 -3
- data/lib/ynab/api_client.rb +0 -2
- data/lib/ynab/api_model_base.rb +85 -0
- data/lib/ynab/models/account.rb +4 -81
- data/lib/ynab/models/account_response.rb +1 -75
- data/lib/ynab/models/account_response_data.rb +1 -75
- data/lib/ynab/models/accounts_response.rb +1 -75
- data/lib/ynab/models/accounts_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response.rb +1 -75
- data/lib/ynab/models/bulk_response_data.rb +1 -75
- data/lib/ynab/models/bulk_response_data_bulk.rb +1 -75
- data/lib/ynab/models/bulk_transactions.rb +1 -75
- data/lib/ynab/models/categories_response.rb +1 -75
- data/lib/ynab/models/categories_response_data.rb +1 -75
- data/lib/ynab/models/category.rb +16 -79
- data/lib/ynab/models/category_group.rb +1 -75
- data/lib/ynab/models/category_group_with_categories.rb +2 -76
- data/lib/ynab/models/category_response.rb +1 -75
- data/lib/ynab/models/category_response_data.rb +1 -75
- data/lib/ynab/models/currency_format.rb +2 -76
- data/lib/ynab/models/date_format.rb +2 -76
- data/lib/ynab/models/error_detail.rb +1 -75
- data/lib/ynab/models/error_response.rb +1 -75
- data/lib/ynab/models/existing_category.rb +180 -0
- data/lib/ynab/models/existing_transaction.rb +1 -79
- data/lib/ynab/models/hybrid_transaction.rb +1 -85
- data/lib/ynab/models/hybrid_transactions_response.rb +1 -75
- data/lib/ynab/models/hybrid_transactions_response_data.rb +1 -75
- data/lib/ynab/models/{budget_summary_response_data.rb → money_movement.rb} +95 -93
- data/lib/ynab/models/money_movement_group.rb +179 -0
- data/lib/ynab/models/{budget_summary_response.rb → money_movement_groups_response.rb} +4 -78
- data/lib/ynab/models/money_movement_groups_response_data.rb +149 -0
- data/lib/ynab/models/{budget_settings_response.rb → money_movements_response.rb} +4 -78
- data/lib/ynab/models/{budget_detail_response_data.rb → money_movements_response_data.rb} +13 -85
- data/lib/ynab/models/month_detail.rb +3 -79
- data/lib/ynab/models/month_detail_response.rb +1 -75
- data/lib/ynab/models/month_detail_response_data.rb +1 -75
- data/lib/ynab/models/month_summaries_response.rb +1 -75
- data/lib/ynab/models/month_summaries_response_data.rb +1 -75
- data/lib/ynab/models/month_summary.rb +2 -76
- data/lib/ynab/models/new_category.rb +180 -0
- data/lib/ynab/models/new_transaction.rb +1 -79
- data/lib/ynab/models/patch_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/patch_category_wrapper.rb +2 -76
- data/lib/ynab/models/patch_month_category_wrapper.rb +1 -75
- data/lib/ynab/models/patch_payee_wrapper.rb +1 -75
- data/lib/ynab/models/patch_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/payee.rb +1 -75
- data/lib/ynab/models/payee_location.rb +1 -75
- data/lib/ynab/models/payee_location_response.rb +1 -75
- data/lib/ynab/models/payee_location_response_data.rb +1 -75
- data/lib/ynab/models/payee_locations_response.rb +1 -75
- data/lib/ynab/models/payee_locations_response_data.rb +1 -75
- data/lib/ynab/models/payee_response.rb +1 -75
- data/lib/ynab/models/payee_response_data.rb +1 -75
- data/lib/ynab/models/payees_response.rb +1 -75
- data/lib/ynab/models/payees_response_data.rb +1 -75
- data/lib/ynab/models/{budget_detail.rb → plan_detail.rb} +7 -83
- data/lib/ynab/models/plan_detail_response.rb +136 -0
- data/lib/ynab/models/plan_detail_response_data.rb +147 -0
- data/lib/ynab/models/{budget_settings.rb → plan_settings.rb} +5 -79
- data/lib/ynab/models/{budget_detail_response.rb → plan_settings_response.rb} +4 -78
- data/lib/ynab/models/{budget_settings_response_data.rb → plan_settings_response_data.rb} +4 -78
- data/lib/ynab/models/{budget_summary.rb → plan_summary.rb} +7 -83
- data/lib/ynab/models/plan_summary_response.rb +136 -0
- data/lib/ynab/models/plan_summary_response_data.rb +147 -0
- data/lib/ynab/models/post_account_wrapper.rb +1 -75
- data/lib/ynab/models/post_category_group_wrapper.rb +136 -0
- data/lib/ynab/models/post_category_wrapper.rb +136 -0
- data/lib/ynab/models/post_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/post_transactions_wrapper.rb +1 -75
- data/lib/ynab/models/put_scheduled_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/put_transaction_wrapper.rb +1 -75
- data/lib/ynab/models/save_account.rb +1 -75
- data/lib/ynab/models/save_category.rb +18 -81
- data/lib/ynab/models/save_category_group.rb +148 -0
- data/lib/ynab/models/save_category_group_response.rb +136 -0
- data/lib/ynab/models/save_category_group_response_data.rb +147 -0
- data/lib/ynab/models/save_category_response.rb +1 -75
- data/lib/ynab/models/save_category_response_data.rb +1 -75
- data/lib/ynab/models/save_month_category.rb +2 -76
- data/lib/ynab/models/save_payee.rb +1 -75
- data/lib/ynab/models/save_payee_response.rb +1 -75
- data/lib/ynab/models/save_payee_response_data.rb +1 -75
- data/lib/ynab/models/save_scheduled_transaction.rb +1 -75
- data/lib/ynab/models/save_sub_transaction.rb +1 -75
- data/lib/ynab/models/save_transaction_with_id_or_import_id.rb +1 -79
- data/lib/ynab/models/save_transaction_with_optional_fields.rb +1 -75
- data/lib/ynab/models/save_transactions_response.rb +1 -75
- data/lib/ynab/models/save_transactions_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_sub_transaction.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_detail.rb +1 -80
- data/lib/ynab/models/scheduled_transaction_response.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_response_data.rb +1 -75
- data/lib/ynab/models/scheduled_transaction_summary.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response.rb +1 -75
- data/lib/ynab/models/scheduled_transactions_response_data.rb +1 -75
- data/lib/ynab/models/sub_transaction.rb +1 -75
- data/lib/ynab/models/transaction_detail.rb +1 -85
- data/lib/ynab/models/transaction_response.rb +1 -75
- data/lib/ynab/models/transaction_response_data.rb +1 -75
- data/lib/ynab/models/transaction_summary.rb +1 -75
- data/lib/ynab/models/transactions_import_response.rb +1 -75
- data/lib/ynab/models/transactions_import_response_data.rb +1 -75
- data/lib/ynab/models/transactions_response.rb +1 -75
- data/lib/ynab/models/transactions_response_data.rb +1 -75
- data/lib/ynab/models/user.rb +1 -75
- data/lib/ynab/models/user_response.rb +1 -75
- data/lib/ynab/models/user_response_data.rb +1 -75
- data/lib/ynab/overrides/transactions_api.rb +6 -6
- data/lib/ynab/version.rb +1 -1
- data/lib/ynab.rb +28 -13
- data/open_api_spec.yaml +1161 -916
- data/spec/api/accounts_spec.rb +9 -9
- data/spec/api/categories_spec.rb +9 -9
- data/spec/api/months_spec.rb +7 -7
- data/spec/api/payee_locations_spec.rb +7 -7
- data/spec/api/payees_spec.rb +7 -7
- data/spec/api/plans_spec.rb +55 -0
- data/spec/api/scheduled_transactions_spec.rb +9 -9
- data/spec/api/transactions_spec.rb +27 -27
- data/spec/fixtures/vcr_cassettes/account.yml +2 -2
- data/spec/fixtures/vcr_cassettes/accounts.yml +2 -2
- data/spec/fixtures/vcr_cassettes/accounts_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/bulk_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/categories.yml +2 -2
- data/spec/fixtures/vcr_cassettes/categories_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/category.yml +2 -2
- data/spec/fixtures/vcr_cassettes/category_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_account.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_scheduled_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/create_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/import_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/month.yml +2 -2
- data/spec/fixtures/vcr_cassettes/month_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/months.yml +2 -2
- data/spec/fixtures/vcr_cassettes/months_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/multiple_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/patch_month_category.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_location.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_locations.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_locations_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payee_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payees.yml +2 -2
- data/spec/fixtures/vcr_cassettes/payees_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/{budget.yml → plan.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/{budgets.yml → plans.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/{budgets_unauthorized.yml → plans_unauthorized.yml} +3 -3
- data/spec/fixtures/vcr_cassettes/scheduled_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/scheduled_transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/scheduled_transactions_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions_invalid_flags.yml +2 -2
- data/spec/fixtures/vcr_cassettes/transactions_unauthorized.yml +2 -2
- data/spec/fixtures/vcr_cassettes/update_transaction.yml +2 -2
- data/spec/fixtures/vcr_cassettes/update_transactions.yml +2 -2
- data/templates/gem.mustache +3 -2
- data/templates/partial_model_generic.mustache +1 -1
- data/ynab.gemspec +1 -2
- metadata +64 -33
- data/docs/BudgetSettingsResponseData.md +0 -8
- data/docs/BudgetSummary.md +0 -15
- data/docs/BudgetSummaryResponse.md +0 -8
- data/docs/BudgetSummaryResponseData.md +0 -9
- data/docs/BudgetsApi.md +0 -68
- data/spec/api/budgets_spec.rb +0 -55
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#YNAB API Endpoints
|
|
3
|
+
|
|
4
|
+
#Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
|
|
5
|
+
|
|
6
|
+
Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
7
|
+
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
require 'date'
|
|
11
|
+
require 'time'
|
|
12
|
+
|
|
13
|
+
module YNAB
|
|
14
|
+
class PlanDetailResponseData < ApiModelBase
|
|
15
|
+
attr_accessor :plan
|
|
16
|
+
|
|
17
|
+
# The knowledge of the server
|
|
18
|
+
attr_accessor :server_knowledge
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'plan' => :'plan',
|
|
24
|
+
:'server_knowledge' => :'server_knowledge'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
|
29
|
+
def self.acceptable_attributes
|
|
30
|
+
attribute_map.values
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.openapi_types
|
|
35
|
+
{
|
|
36
|
+
:'plan' => :'PlanDetail',
|
|
37
|
+
:'server_knowledge' => :'Integer'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# List of attributes with nullable: true
|
|
42
|
+
def self.openapi_nullable
|
|
43
|
+
Set.new([
|
|
44
|
+
])
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Initializes the object
|
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
49
|
+
def initialize(attributes = {})
|
|
50
|
+
if (!attributes.is_a?(Hash))
|
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PlanDetailResponseData` initialize method"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PlanDetailResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
58
|
+
end
|
|
59
|
+
h[k.to_sym] = v
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if attributes.key?(:'plan')
|
|
63
|
+
self.plan = attributes[:'plan']
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'server_knowledge')
|
|
67
|
+
self.server_knowledge = attributes[:'server_knowledge']
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
72
|
+
# @return Array for valid properties with the reasons
|
|
73
|
+
def list_invalid_properties
|
|
74
|
+
invalid_properties = Array.new
|
|
75
|
+
invalid_properties
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Check to see if the all the properties in the model are valid
|
|
79
|
+
# @return true if the model is valid
|
|
80
|
+
def valid?
|
|
81
|
+
return false if @plan.nil?
|
|
82
|
+
return false if @server_knowledge.nil?
|
|
83
|
+
true
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Checks equality by comparing each attribute.
|
|
87
|
+
# @param [Object] Object to be compared
|
|
88
|
+
def ==(o)
|
|
89
|
+
return true if self.equal?(o)
|
|
90
|
+
self.class == o.class &&
|
|
91
|
+
plan == o.plan &&
|
|
92
|
+
server_knowledge == o.server_knowledge
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# @see the `==` method
|
|
96
|
+
# @param [Object] Object to be compared
|
|
97
|
+
def eql?(o)
|
|
98
|
+
self == o
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Calculates hash code according to all attributes.
|
|
102
|
+
# @return [Integer] Hash code
|
|
103
|
+
def hash
|
|
104
|
+
[plan, server_knowledge].hash
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Builds the object from hash
|
|
108
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
109
|
+
# @return [Object] Returns the model itself
|
|
110
|
+
def self.build_from_hash(attributes)
|
|
111
|
+
return nil unless attributes.is_a?(Hash)
|
|
112
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
113
|
+
transformed_hash = {}
|
|
114
|
+
openapi_types.each_pair do |key, type|
|
|
115
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
116
|
+
transformed_hash["#{key}"] = nil
|
|
117
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
118
|
+
# check to ensure the input is an array given that the attribute
|
|
119
|
+
# is documented as an array but the input is not
|
|
120
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
121
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
122
|
+
end
|
|
123
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
124
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
new(transformed_hash)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Returns the object in the form of hash
|
|
131
|
+
# @return [Hash] Returns the object in the form of hash
|
|
132
|
+
def to_hash
|
|
133
|
+
hash = {}
|
|
134
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
135
|
+
value = self.send(attr)
|
|
136
|
+
if value.nil?
|
|
137
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
138
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
hash[param] = _to_hash(value)
|
|
142
|
+
end
|
|
143
|
+
hash
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class
|
|
14
|
+
class PlanSettings < ApiModelBase
|
|
15
15
|
attr_accessor :date_format
|
|
16
16
|
|
|
17
17
|
attr_accessor :currency_format
|
|
@@ -40,8 +40,6 @@ module YNAB
|
|
|
40
40
|
# List of attributes with nullable: true
|
|
41
41
|
def self.openapi_nullable
|
|
42
42
|
Set.new([
|
|
43
|
-
:'date_format',
|
|
44
|
-
:'currency_format'
|
|
45
43
|
])
|
|
46
44
|
end
|
|
47
45
|
|
|
@@ -49,13 +47,13 @@ module YNAB
|
|
|
49
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
50
48
|
def initialize(attributes = {})
|
|
51
49
|
if (!attributes.is_a?(Hash))
|
|
52
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PlanSettings` initialize method"
|
|
53
51
|
end
|
|
54
52
|
|
|
55
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
56
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
57
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
58
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PlanSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
59
57
|
end
|
|
60
58
|
h[k.to_sym] = v
|
|
61
59
|
}
|
|
@@ -79,6 +77,8 @@ module YNAB
|
|
|
79
77
|
# Check to see if the all the properties in the model are valid
|
|
80
78
|
# @return true if the model is valid
|
|
81
79
|
def valid?
|
|
80
|
+
return false if @date_format.nil?
|
|
81
|
+
return false if @currency_format.nil?
|
|
82
82
|
true
|
|
83
83
|
end
|
|
84
84
|
|
|
@@ -126,61 +126,6 @@ module YNAB
|
|
|
126
126
|
new(transformed_hash)
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
# Deserializes the data based on type
|
|
130
|
-
# @param string type Data type
|
|
131
|
-
# @param string value Value to be deserialized
|
|
132
|
-
# @return [Object] Deserialized data
|
|
133
|
-
def self._deserialize(type, value)
|
|
134
|
-
case type.to_sym
|
|
135
|
-
when :Time
|
|
136
|
-
Time.parse(value)
|
|
137
|
-
when :Date
|
|
138
|
-
Date.parse(value)
|
|
139
|
-
when :String
|
|
140
|
-
value.to_s
|
|
141
|
-
when :Integer
|
|
142
|
-
value.to_i
|
|
143
|
-
when :Float
|
|
144
|
-
value.to_f
|
|
145
|
-
when :Boolean
|
|
146
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
147
|
-
true
|
|
148
|
-
else
|
|
149
|
-
false
|
|
150
|
-
end
|
|
151
|
-
when :Object
|
|
152
|
-
# generic object (usually a Hash), return directly
|
|
153
|
-
value
|
|
154
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
155
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
156
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
157
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
158
|
-
k_type = Regexp.last_match[:k_type]
|
|
159
|
-
v_type = Regexp.last_match[:v_type]
|
|
160
|
-
{}.tap do |hash|
|
|
161
|
-
value.each do |k, v|
|
|
162
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
163
|
-
end
|
|
164
|
-
end
|
|
165
|
-
else # model
|
|
166
|
-
# models (e.g. Pet) or oneOf
|
|
167
|
-
klass = YNAB.const_get(type)
|
|
168
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
169
|
-
end
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
# Returns the string representation of the object
|
|
173
|
-
# @return [String] String presentation of the object
|
|
174
|
-
def to_s
|
|
175
|
-
to_hash.to_s
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
179
|
-
# @return [Hash] Returns the object in the form of hash
|
|
180
|
-
def to_body
|
|
181
|
-
to_hash
|
|
182
|
-
end
|
|
183
|
-
|
|
184
129
|
# Returns the object in the form of hash
|
|
185
130
|
# @return [Hash] Returns the object in the form of hash
|
|
186
131
|
def to_hash
|
|
@@ -196,25 +141,6 @@ module YNAB
|
|
|
196
141
|
end
|
|
197
142
|
hash
|
|
198
143
|
end
|
|
199
|
-
|
|
200
|
-
# Outputs non-array value in the form of hash
|
|
201
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
202
|
-
# @param [Object] value Any valid value
|
|
203
|
-
# @return [Hash] Returns the value in the form of hash
|
|
204
|
-
def _to_hash(value)
|
|
205
|
-
if value.is_a?(Array)
|
|
206
|
-
value.compact.map { |v| _to_hash(v) }
|
|
207
|
-
elsif value.is_a?(Hash)
|
|
208
|
-
{}.tap do |hash|
|
|
209
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
210
|
-
end
|
|
211
|
-
elsif value.respond_to? :to_hash
|
|
212
|
-
value.to_hash
|
|
213
|
-
else
|
|
214
|
-
value
|
|
215
|
-
end
|
|
216
|
-
end
|
|
217
|
-
|
|
218
144
|
end
|
|
219
145
|
|
|
220
146
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class
|
|
14
|
+
class PlanSettingsResponse < ApiModelBase
|
|
15
15
|
attr_accessor :data
|
|
16
16
|
|
|
17
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -29,7 +29,7 @@ module YNAB
|
|
|
29
29
|
# Attribute type mapping.
|
|
30
30
|
def self.openapi_types
|
|
31
31
|
{
|
|
32
|
-
:'data' => :'
|
|
32
|
+
:'data' => :'PlanSettingsResponseData'
|
|
33
33
|
}
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -43,13 +43,13 @@ module YNAB
|
|
|
43
43
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
44
|
def initialize(attributes = {})
|
|
45
45
|
if (!attributes.is_a?(Hash))
|
|
46
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::
|
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PlanSettingsResponse` initialize method"
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
50
50
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
51
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::
|
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PlanSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
53
53
|
end
|
|
54
54
|
h[k.to_sym] = v
|
|
55
55
|
}
|
|
@@ -116,61 +116,6 @@ module YNAB
|
|
|
116
116
|
new(transformed_hash)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
# Deserializes the data based on type
|
|
120
|
-
# @param string type Data type
|
|
121
|
-
# @param string value Value to be deserialized
|
|
122
|
-
# @return [Object] Deserialized data
|
|
123
|
-
def self._deserialize(type, value)
|
|
124
|
-
case type.to_sym
|
|
125
|
-
when :Time
|
|
126
|
-
Time.parse(value)
|
|
127
|
-
when :Date
|
|
128
|
-
Date.parse(value)
|
|
129
|
-
when :String
|
|
130
|
-
value.to_s
|
|
131
|
-
when :Integer
|
|
132
|
-
value.to_i
|
|
133
|
-
when :Float
|
|
134
|
-
value.to_f
|
|
135
|
-
when :Boolean
|
|
136
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
137
|
-
true
|
|
138
|
-
else
|
|
139
|
-
false
|
|
140
|
-
end
|
|
141
|
-
when :Object
|
|
142
|
-
# generic object (usually a Hash), return directly
|
|
143
|
-
value
|
|
144
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
145
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
146
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
147
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
148
|
-
k_type = Regexp.last_match[:k_type]
|
|
149
|
-
v_type = Regexp.last_match[:v_type]
|
|
150
|
-
{}.tap do |hash|
|
|
151
|
-
value.each do |k, v|
|
|
152
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
else # model
|
|
156
|
-
# models (e.g. Pet) or oneOf
|
|
157
|
-
klass = YNAB.const_get(type)
|
|
158
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Returns the string representation of the object
|
|
163
|
-
# @return [String] String presentation of the object
|
|
164
|
-
def to_s
|
|
165
|
-
to_hash.to_s
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
169
|
-
# @return [Hash] Returns the object in the form of hash
|
|
170
|
-
def to_body
|
|
171
|
-
to_hash
|
|
172
|
-
end
|
|
173
|
-
|
|
174
119
|
# Returns the object in the form of hash
|
|
175
120
|
# @return [Hash] Returns the object in the form of hash
|
|
176
121
|
def to_hash
|
|
@@ -186,25 +131,6 @@ module YNAB
|
|
|
186
131
|
end
|
|
187
132
|
hash
|
|
188
133
|
end
|
|
189
|
-
|
|
190
|
-
# Outputs non-array value in the form of hash
|
|
191
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
192
|
-
# @param [Object] value Any valid value
|
|
193
|
-
# @return [Hash] Returns the value in the form of hash
|
|
194
|
-
def _to_hash(value)
|
|
195
|
-
if value.is_a?(Array)
|
|
196
|
-
value.compact.map { |v| _to_hash(v) }
|
|
197
|
-
elsif value.is_a?(Hash)
|
|
198
|
-
{}.tap do |hash|
|
|
199
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
200
|
-
end
|
|
201
|
-
elsif value.respond_to? :to_hash
|
|
202
|
-
value.to_hash
|
|
203
|
-
else
|
|
204
|
-
value
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
|
|
208
134
|
end
|
|
209
135
|
|
|
210
136
|
end
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class
|
|
14
|
+
class PlanSettingsResponseData < ApiModelBase
|
|
15
15
|
attr_accessor :settings
|
|
16
16
|
|
|
17
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -29,7 +29,7 @@ module YNAB
|
|
|
29
29
|
# Attribute type mapping.
|
|
30
30
|
def self.openapi_types
|
|
31
31
|
{
|
|
32
|
-
:'settings' => :'
|
|
32
|
+
:'settings' => :'PlanSettings'
|
|
33
33
|
}
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -43,13 +43,13 @@ module YNAB
|
|
|
43
43
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
44
|
def initialize(attributes = {})
|
|
45
45
|
if (!attributes.is_a?(Hash))
|
|
46
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::
|
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PlanSettingsResponseData` initialize method"
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
50
50
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
51
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::
|
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PlanSettingsResponseData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
53
53
|
end
|
|
54
54
|
h[k.to_sym] = v
|
|
55
55
|
}
|
|
@@ -116,61 +116,6 @@ module YNAB
|
|
|
116
116
|
new(transformed_hash)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
# Deserializes the data based on type
|
|
120
|
-
# @param string type Data type
|
|
121
|
-
# @param string value Value to be deserialized
|
|
122
|
-
# @return [Object] Deserialized data
|
|
123
|
-
def self._deserialize(type, value)
|
|
124
|
-
case type.to_sym
|
|
125
|
-
when :Time
|
|
126
|
-
Time.parse(value)
|
|
127
|
-
when :Date
|
|
128
|
-
Date.parse(value)
|
|
129
|
-
when :String
|
|
130
|
-
value.to_s
|
|
131
|
-
when :Integer
|
|
132
|
-
value.to_i
|
|
133
|
-
when :Float
|
|
134
|
-
value.to_f
|
|
135
|
-
when :Boolean
|
|
136
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
137
|
-
true
|
|
138
|
-
else
|
|
139
|
-
false
|
|
140
|
-
end
|
|
141
|
-
when :Object
|
|
142
|
-
# generic object (usually a Hash), return directly
|
|
143
|
-
value
|
|
144
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
145
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
146
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
147
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
148
|
-
k_type = Regexp.last_match[:k_type]
|
|
149
|
-
v_type = Regexp.last_match[:v_type]
|
|
150
|
-
{}.tap do |hash|
|
|
151
|
-
value.each do |k, v|
|
|
152
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
else # model
|
|
156
|
-
# models (e.g. Pet) or oneOf
|
|
157
|
-
klass = YNAB.const_get(type)
|
|
158
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
# Returns the string representation of the object
|
|
163
|
-
# @return [String] String presentation of the object
|
|
164
|
-
def to_s
|
|
165
|
-
to_hash.to_s
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
169
|
-
# @return [Hash] Returns the object in the form of hash
|
|
170
|
-
def to_body
|
|
171
|
-
to_hash
|
|
172
|
-
end
|
|
173
|
-
|
|
174
119
|
# Returns the object in the form of hash
|
|
175
120
|
# @return [Hash] Returns the object in the form of hash
|
|
176
121
|
def to_hash
|
|
@@ -186,25 +131,6 @@ module YNAB
|
|
|
186
131
|
end
|
|
187
132
|
hash
|
|
188
133
|
end
|
|
189
|
-
|
|
190
|
-
# Outputs non-array value in the form of hash
|
|
191
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
192
|
-
# @param [Object] value Any valid value
|
|
193
|
-
# @return [Hash] Returns the value in the form of hash
|
|
194
|
-
def _to_hash(value)
|
|
195
|
-
if value.is_a?(Array)
|
|
196
|
-
value.compact.map { |v| _to_hash(v) }
|
|
197
|
-
elsif value.is_a?(Hash)
|
|
198
|
-
{}.tap do |hash|
|
|
199
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
200
|
-
end
|
|
201
|
-
elsif value.respond_to? :to_hash
|
|
202
|
-
value.to_hash
|
|
203
|
-
else
|
|
204
|
-
value
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
|
|
208
134
|
end
|
|
209
135
|
|
|
210
136
|
end
|
|
@@ -11,25 +11,25 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module YNAB
|
|
14
|
-
class
|
|
14
|
+
class PlanSummary < ApiModelBase
|
|
15
15
|
attr_accessor :id
|
|
16
16
|
|
|
17
17
|
attr_accessor :name
|
|
18
18
|
|
|
19
|
-
# The last time any changes were made to the
|
|
19
|
+
# The last time any changes were made to the plan from either a web or mobile client
|
|
20
20
|
attr_accessor :last_modified_on
|
|
21
21
|
|
|
22
|
-
# The earliest
|
|
22
|
+
# The earliest plan month
|
|
23
23
|
attr_accessor :first_month
|
|
24
24
|
|
|
25
|
-
# The latest
|
|
25
|
+
# The latest plan month
|
|
26
26
|
attr_accessor :last_month
|
|
27
27
|
|
|
28
28
|
attr_accessor :date_format
|
|
29
29
|
|
|
30
30
|
attr_accessor :currency_format
|
|
31
31
|
|
|
32
|
-
# The
|
|
32
|
+
# The plan accounts (only included if `include_accounts=true` specified as query parameter)
|
|
33
33
|
attr_accessor :accounts
|
|
34
34
|
|
|
35
35
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -68,8 +68,6 @@ module YNAB
|
|
|
68
68
|
# List of attributes with nullable: true
|
|
69
69
|
def self.openapi_nullable
|
|
70
70
|
Set.new([
|
|
71
|
-
:'date_format',
|
|
72
|
-
:'currency_format',
|
|
73
71
|
])
|
|
74
72
|
end
|
|
75
73
|
|
|
@@ -77,13 +75,13 @@ module YNAB
|
|
|
77
75
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
76
|
def initialize(attributes = {})
|
|
79
77
|
if (!attributes.is_a?(Hash))
|
|
80
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::
|
|
78
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `YNAB::PlanSummary` initialize method"
|
|
81
79
|
end
|
|
82
80
|
|
|
83
81
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
82
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
83
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::
|
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `YNAB::PlanSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
87
85
|
end
|
|
88
86
|
h[k.to_sym] = v
|
|
89
87
|
}
|
|
@@ -188,61 +186,6 @@ module YNAB
|
|
|
188
186
|
new(transformed_hash)
|
|
189
187
|
end
|
|
190
188
|
|
|
191
|
-
# Deserializes the data based on type
|
|
192
|
-
# @param string type Data type
|
|
193
|
-
# @param string value Value to be deserialized
|
|
194
|
-
# @return [Object] Deserialized data
|
|
195
|
-
def self._deserialize(type, value)
|
|
196
|
-
case type.to_sym
|
|
197
|
-
when :Time
|
|
198
|
-
Time.parse(value)
|
|
199
|
-
when :Date
|
|
200
|
-
Date.parse(value)
|
|
201
|
-
when :String
|
|
202
|
-
value.to_s
|
|
203
|
-
when :Integer
|
|
204
|
-
value.to_i
|
|
205
|
-
when :Float
|
|
206
|
-
value.to_f
|
|
207
|
-
when :Boolean
|
|
208
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
209
|
-
true
|
|
210
|
-
else
|
|
211
|
-
false
|
|
212
|
-
end
|
|
213
|
-
when :Object
|
|
214
|
-
# generic object (usually a Hash), return directly
|
|
215
|
-
value
|
|
216
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
217
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
218
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
219
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
220
|
-
k_type = Regexp.last_match[:k_type]
|
|
221
|
-
v_type = Regexp.last_match[:v_type]
|
|
222
|
-
{}.tap do |hash|
|
|
223
|
-
value.each do |k, v|
|
|
224
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
225
|
-
end
|
|
226
|
-
end
|
|
227
|
-
else # model
|
|
228
|
-
# models (e.g. Pet) or oneOf
|
|
229
|
-
klass = YNAB.const_get(type)
|
|
230
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
231
|
-
end
|
|
232
|
-
end
|
|
233
|
-
|
|
234
|
-
# Returns the string representation of the object
|
|
235
|
-
# @return [String] String presentation of the object
|
|
236
|
-
def to_s
|
|
237
|
-
to_hash.to_s
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
241
|
-
# @return [Hash] Returns the object in the form of hash
|
|
242
|
-
def to_body
|
|
243
|
-
to_hash
|
|
244
|
-
end
|
|
245
|
-
|
|
246
189
|
# Returns the object in the form of hash
|
|
247
190
|
# @return [Hash] Returns the object in the form of hash
|
|
248
191
|
def to_hash
|
|
@@ -258,25 +201,6 @@ module YNAB
|
|
|
258
201
|
end
|
|
259
202
|
hash
|
|
260
203
|
end
|
|
261
|
-
|
|
262
|
-
# Outputs non-array value in the form of hash
|
|
263
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
264
|
-
# @param [Object] value Any valid value
|
|
265
|
-
# @return [Hash] Returns the value in the form of hash
|
|
266
|
-
def _to_hash(value)
|
|
267
|
-
if value.is_a?(Array)
|
|
268
|
-
value.compact.map { |v| _to_hash(v) }
|
|
269
|
-
elsif value.is_a?(Hash)
|
|
270
|
-
{}.tap do |hash|
|
|
271
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
272
|
-
end
|
|
273
|
-
elsif value.respond_to? :to_hash
|
|
274
|
-
value.to_hash
|
|
275
|
-
else
|
|
276
|
-
value
|
|
277
|
-
end
|
|
278
|
-
end
|
|
279
|
-
|
|
280
204
|
end
|
|
281
205
|
|
|
282
206
|
end
|