Module: Fugle::HTTP::API::ClassMethods Private

Defined in:
lib/fugle/http/api.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#data_nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



66
67
68
# File 'lib/fugle/http/api.rb', line 66

def data_name
  @data_name ||= name.split('::').last.downcase
end

#parametersObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



49
50
51
# File 'lib/fugle/http/api.rb', line 49

def parameters
  @_parameters
end

#params(name, options = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



43
44
45
# File 'lib/fugle/http/api.rb', line 43

def params(name, options = {})
  @_parameters.add(name, options)
end

#path(value = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



35
36
37
38
39
# File 'lib/fugle/http/api.rb', line 35

def path(value = nil)
  return @_path if value.nil?

  @_path = value
end

#uri(query = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



55
56
57
58
59
60
61
62
# File 'lib/fugle/http/api.rb', line 55

def uri(query = {})
  uri = URI("#{ENDPOINT}/#{VERSION}/#{path}")
  uri.query = Query.new(
    query.merge(apiToken: Fugle.config.api_token),
    parameters
  ).to_s
  uri
end