Permalink
Browse files

Refactored Growl::Base.switch

  • Loading branch information...
tj committed Apr 9, 2009
1 parent 0918ad9 commit 6aabd4dad0b762172abae2221936f912b584b72a
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/growl/growl.rb
View
@@ -124,8 +124,7 @@ def run
def self.switch name
ivar = :"@#{name}"
(@switches ||= []) << name
- define_method(:"#{name}") { instance_variable_get(ivar) }
- define_method(:"#{name}=") { |value| instance_variable_set(ivar, value) }
+ attr_accessor :"#{name}"
define_method(:"#{name}?") { !! instance_variable_get(ivar) }
define_method(:"#{name}!") { instance_variable_set(ivar, true) }
end

0 comments on commit 6aabd4d

Please sign in to comment.