Class: Helo::Core::API

Inherits:
Object
  • Object
show all
Defined in:
lib/helo/core/api.rb

Overview

Base class for all API resources

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ API

Returns a new instance of API.



18
19
20
# File 'lib/helo/core/api.rb', line 18

def initialize(client)
  @client = client
end

Class Method Details

.class_methods(*methods) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/helo/core/api.rb', line 10

def self.class_methods(*methods)
  methods.each do |method|
    define_singleton_method(method) do |*args, **kwargs, &block|
      new(default_client).public_send(method, *args, **kwargs, &block)
    end
  end
end