Module: YandexDelivery
- Defined in:
- lib/yandex-delivery.rb,
lib/yandex-delivery/request.rb,
lib/yandex-delivery/version.rb,
lib/yandex-delivery/response.rb,
lib/yandex-delivery/api_request.rb,
lib/yandex-delivery/yandex_error.rb,
lib/yandex-delivery/yandex_delivery_error.rb,
lib/generators/yandex_delivery/install/install_generator.rb
Defined Under Namespace
Classes: APIRequest, DynamicSetting, InstallGenerator, Request, Response, YandexDeliveryError, YandexError
Constant Summary
collapse
- VERSION =
"0.0.5"
Class Method Summary
collapse
Class Method Details
.add_reader(name) ⇒ Object
21
22
23
24
25
|
# File 'lib/yandex-delivery.rb', line 21
def add_reader(name)
define_singleton_method(name) do |*args|
send("#{name}_setting").value(*args)
end
end
|
.add_writer(name, type) ⇒ Object
27
28
29
30
31
|
# File 'lib/yandex-delivery.rb', line 27
def add_writer(name, type)
define_singleton_method("#{name}=") do |value|
send("#{name}_setting=", DynamicSetting.build(value, type))
end
end
|
.register(name, value, type = nil) ⇒ Object
13
14
15
16
17
18
19
|
# File 'lib/yandex-delivery.rb', line 13
def register(name, value, type = nil)
cattr_accessor "#{name}_setting".to_sym
add_reader(name)
add_writer(name, type)
send "#{name}=", value
end
|
.setup {|_self| ... } ⇒ Object
9
10
11
|
# File 'lib/yandex-delivery.rb', line 9
def setup
yield self
end
|