From 36c59f52c2e7255e9586ba42e4e0db9f8928350f Mon Sep 17 00:00:00 2001 From: Mark Rickert Date: Fri, 13 Sep 2013 05:33:52 -0400 Subject: [PATCH] Implement method_missing on the map annotations to try and return a parameter named what the user asked for. --- lib/ProMotion/map/map_screen_annotation.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ProMotion/map/map_screen_annotation.rb b/lib/ProMotion/map/map_screen_annotation.rb index 267a408..6e5c68a 100644 --- a/lib/ProMotion/map/map_screen_annotation.rb +++ b/lib/ProMotion/map/map_screen_annotation.rb @@ -52,5 +52,13 @@ module ProMotion @params end + def method_missing(meth, *args) + if @params[meth.to_sym] + @params[meth.to_sym] + else + PM.logger.warn "The annotation parameter \"#{meth}\" does not exist on this pin." + end + end + end end