Sha256: 8697882772047e1f32b1d4049290451d5b489153b6150b0543f9a5c0c9c88de7

Contents?: true

Size: 403 Bytes

Versions: 5

Compression:

Stored size: 403 Bytes

Contents

module SirenClient
  def self.get(options)
    if options.is_a? String
      Entity.new(options)
    elsif options.is_a? Hash
      url = options[:url] || options['url']
      raise ArgumentError, "You must supply a valid url to SirenClient.get" unless url
      Entity.new(url, options)
    else
      raise ArgumentError, 'You must supply either a string or hash to SirenClient.get'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
siren_client-2.0.1 lib/siren_client/base.rb
siren_client-2.0.0 lib/siren_client/base.rb
siren_client-1.0.2 lib/siren_client/base.rb
siren_client-1.0.1 lib/siren_client/base.rb
siren_client-1.0.0 lib/siren_client/base.rb