Class: DbAgile::Restful::Client

Inherits:
Object
  • Object
show all
Includes:
Delete, Get, Post, Utils, Tools::Tuple
Defined in:
lib/dbagile/restful/client.rb,
lib/dbagile/restful/client/get.rb,
lib/dbagile/restful/client/post.rb,
lib/dbagile/restful/client/utils.rb,
lib/dbagile/restful/client/delete.rb

Overview

Helper to query the restful server

Defined Under Namespace

Modules: Delete, Get, Post, Utils

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Tools::Tuple

#check_tuple_heading, #tuple_has_key?, #tuple_heading, #tuple_key, #tuple_project, #tuple_to_querystring

Methods included from Delete

#delete

Methods included from Post

#post

Methods included from Get

#get

Methods included from Utils

#with_uri

Constructor Details

#initialize(server_uri) ⇒ Client

Creates a client instance.

Parameters:

  • the (String|URI)

    uri of the restful server



28
29
30
31
32
33
34
35
36
37
# File 'lib/dbagile/restful/client.rb', line 28

def initialize(server_uri)
  @server_uri = case server_uri
    when URI
      server_uri
    when String
      URI.parse(server_uri)
    else
      raise ArgumentError, "Invalid server uri: #{server_uri}"
  end
end

Instance Attribute Details

#server_uriObject (readonly)

Server uri



21
22
23
# File 'lib/dbagile/restful/client.rb', line 21

def server_uri
  @server_uri
end