Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/proxy_party.rb
Instance Method Summary collapse
- #named_proxies(hash) ⇒ Object
- #party_proxy ⇒ Object (also: #proxy_party)
- #proxy(*proxy_objs) ⇒ Object
Instance Method Details
#named_proxies(hash) ⇒ Object
346 347 348 349 350 351 352 |
# File 'lib/proxy_party.rb', line 346 def named_proxies hash raise ArgumentError, "Argument must be a hash" if !hash.kind_of? Hash include Party::Proxy hash.each_pair do |proxy, methods| proxy_accessors_for proxy, methods end end |
#party_proxy ⇒ Object Also known as: proxy_party
341 342 343 |
# File 'lib/proxy_party.rb', line 341 def party_proxy include Party::Proxy end |
#proxy(*proxy_objs) ⇒ Object
354 355 356 357 358 359 360 361 362 363 |
# File 'lib/proxy_party.rb', line 354 def proxy *proxy_objs include Party::Proxy proxy_objs.flat_uniq.each do |proxy_obj| raise ArgumentError, "bad proxy object #{proxy_obj}" if !proxy_obj.kind_of_label? attr_accessor proxy_obj @proxies ||= [] @proxies << proxy_obj if !@proxies.include? proxy_obj end end |