class Artifactory::Resource::Base

def from_hash(hash, options = {})

Returns:
  • (~Resource::Base) -

Options Hash: (**options)
  • :client (Artifactory::Client) --

Parameters:
  • options (Hash) --
  • hash (Hash) --
def from_hash(hash, options = {})
  instance = new
  instance.client = extract_client!(options)
  hash.inject(instance) do |instance, (key, value)|
    method = :"#{Util.underscore(key)}="
    if instance.respond_to?(method)
      instance.send(method, value)
    end
    instance
  end
end