Permalink
Browse files

declare methods that usually shouldn't be overriden as private

  • Loading branch information...
1 parent 693bb0c commit e56b55fd045f4e81e9d7ebb6b0f1ea25713ec33a @mislav committed Oct 25, 2009
Showing with 12 additions and 10 deletions.
  1. +12 −10 scraper.rb
View
@@ -55,10 +55,20 @@ def parse_result(node, delegate)
end
end
+ private
+
+ def self.rules
+ @rules ||= {}
+ end
+
+ def self.inherited(subclass)
+ subclass.rules.update self.rules
+ end
+
# Rule declaration is in Hash or single argument form:
#
- # { '//some/selector' => :name, :with => MyClass }
- # #=> ['//some/selector', :name, MyClass]
+ # { '//some/selector' => :name, :with => delegate }
+ # #=> ['//some/selector', :name, delegate]
#
# :title
# #=> ['title', :title, nil]
@@ -72,14 +82,6 @@ def self.parse_rule_declaration(*args, &block)
return selector, property, delegate
end
- def self.rules
- @rules ||= {}
- end
-
- def self.inherited(subclass)
- subclass.rules.update self.rules
- end
-
def initialize_plural_accessors
self.class.rules.each do |name, (s, k, plural)|
send("#{name}=", []) if plural

0 comments on commit e56b55f

Please sign in to comment.