Class: Rubyists::Kalshi::Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/kalshi/endpoint.rb

Overview

Base class for Kalshi API endpoints

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client = nil) ⇒ void

Initialize the Endpoint

Parameters:

  • client (Client) (defaults to: nil) —

    The Kalshi client



27
28
29
# File 'lib/kalshi/endpoint.rb', line 27

def initialize(client = nil)
  @client = client || Client.new
end

Class Attribute Details

.endpoint_path ⇒ Object

Returns the value of attribute endpoint_path.



10
11
12
# File 'lib/kalshi/endpoint.rb', line 10

def endpoint_path
  @endpoint_path
end

Instance Attribute Details

#client ⇒ Object (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/kalshi/endpoint.rb', line 7

def client
  @client
end

Class Method Details

.kalshi_path(path) ⇒ String

Set the endpoint path for the resource

Parameters:

  • path (String) —

    API endpoint path

Returns:

  • (String) —

    endpoint path



17
18
19
# File 'lib/kalshi/endpoint.rb', line 17

def kalshi_path(path)
  self.endpoint_path = path
end