Skip to content

Commit

Permalink
Add docs to #from_hash
Browse files Browse the repository at this point in the history
Add docs to try and trigger the CI build.
  • Loading branch information
ianoxley committed Jan 27, 2023
1 parent 0cd8701 commit 0f2ae15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/hash_kit/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def to_hash(obj)
hash
end

# Return an object of type klass from the values in the given hash
#
# @param [Hash] hash
# @param [Class] klass
# @param [Array] transforms
# @return [Object]
def from_hash(hash, klass, transforms = [])
obj = klass.new
return obj if hash.nil? || hash.empty?
Expand Down

0 comments on commit 0f2ae15

Please sign in to comment.