module RestIP::RestAdapter
Public Instance Methods
rest_adapter()
click to toggle source
# File lib/rest_ip/rest_adapter.rb, line 3 def rest_adapter @@rest_adapter end
rest_adapter=(name_or_adapter)
click to toggle source
# File lib/rest_ip/rest_adapter.rb, line 7 def rest_adapter=(name_or_adapter) @@rest_adapter = case name_or_adapter when String, Symbol load_adapter name_or_adapter when Class name_or_adapter end end
Private Instance Methods
load_adapter(name)
click to toggle source
# File lib/rest_ip/rest_adapter.rb, line 19 def load_adapter(name) require "rest_ip/rest_adapters/#{name}_adapter" Object.const_get "RestIP::RestAdapters::#{name.to_s.capitalize}Adapter" end