lib/litc.rb in litc-1.0.2 vs lib/litc.rb in litc-1.0.3

- old
+ new

@@ -37,22 +37,22 @@ # 2007-03-01 # 2009-08-15 # latest API_VERSION = "latest" - def urlize item + def self.urlize item item = item.to_s.gsub(/_/, '-') if item =~ /(placement).+/ or item =~ /(block-device-mapping).+/ item.gsub!(/(#{$1})-(.*)$/,'\\1/\\2') end if item =~ /block-device-mapping$/ or item =~ /placement$/ or item =~ /public-keys$/ item << "/" end item end - def get(item) + def self.get(item) item = urlize(item) if item != 'user-data' item = "meta-data/#{item}" end @@ -63,10 +63,10 @@ when Net::HTTPSuccess then response.body.strip else nil end end - def method_missing(meth, *args, &block) + def self.method_missing(meth, *args, &block) if ITEMS.include?(urlize(meth)) get(meth) else raise(NoMethodError, "undefined method '#{meth}' for Litc") end