Class: Cdek::Resources::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cdek/resources/base.rb

Overview

Базовый класс для high-level ресурсов CDEK API.

Хранит ссылку на клиент. Конкретные ресурсы (Locations, Deliverypoints и т.п.) наследуются и проксируют вызовы в client.get/post/…

Direct Known Subclasses

Deliverypoints, Locations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client = Cdek.client) ⇒ Base

Returns a new instance of Base.



12
13
14
# File 'lib/cdek/resources/base.rb', line 12

def initialize(client = Cdek.client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/cdek/resources/base.rb', line 10

def client
  @client
end