Skip to content

Commit

Permalink
feat: Added an escape hatch for setting new values
Browse files Browse the repository at this point in the history
  • Loading branch information
joynerd committed Jan 4, 2023
1 parent a9cf07d commit 7df1b31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
close (0.7.5)
close (0.8.0)
faraday (>= 2.0.0)
ostruct

Expand Down
9 changes: 9 additions & 0 deletions lib/close/api_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ def values
@values.merge(@new_values)
end

# Escape hatch for new values. Instead of using the defined
# accessors, you can use this method to set a value.
# @param key [String] the key to set.
# @param value [String] the value to set.
# @return [String] the value.
def set(key, value)
@new_values[key] = value
end

# Updates the resource on the server. Will not make a request
# if there are no unsaved changes.
# @return [Boolean] true if the update succeeded, false otherwise.
Expand Down

0 comments on commit 7df1b31

Please sign in to comment.