lib/aua-mite/agents/fuerst.rb in aua-mite-0.0.3 vs lib/aua-mite/agents/fuerst.rb in aua-mite-0.0.4

- old
+ new

@@ -1,22 +1,23 @@ module Aua::Agents::Fuerst + PATTERN = /^(DynaMite|GrandTotal|TimeLog)/ + def self.extend?(agent) - agent.app == "DynaMite" || agent.app == "GrandTotal" || - agent.app =~ /^DynaMite/ || agent.app =~ /^GrandTotal/ + agent.app =~ PATTERN end def type :ApiClient end def name - @name ||= app =~ /^GrandTotal/ ? :GrandTotal : :DynaMite + @name ||= app.match(PATTERN)[1].to_sym end def version @version ||= begin - return versions.first if app == "DynaMite" || app == "GrandTotal" - app.sub(/^DynaMite|GrandTotal/, "") + return versions.first if app == "DynaMite" || app == "GrandTotal" || app == "TimeLog" + app.sub(PATTERN, "") end end end \ No newline at end of file