Class: DataMapper::YunkerStar::Scraper::Base
- Inherits:
-
Object
- Object
- DataMapper::YunkerStar::Scraper::Base
- Includes:
- CachedAccessor
- Defined in:
- lib/dm-ys/scraper.rb
Overview
Base Scraper
Instance Method Summary collapse
-
#initialize(model, *args) ⇒ Base
constructor
A new instance of Base.
- #register_properties! ⇒ Object
- #uri ⇒ Object
Methods included from CachedAccessor
Constructor Details
#initialize(model, *args) ⇒ Base
Returns a new instance of Base.
53 54 55 56 57 |
# File 'lib/dm-ys/scraper.rb', line 53 def initialize(model, *args) raise ArgumentError, "missing model" unless model raise ArgumentError, "missing uri" unless model.uri @model = model end |
Instance Method Details
#register_properties! ⇒ Object
66 67 68 69 70 71 |
# File 'lib/dm-ys/scraper.rb', line 66 def register_properties! names.each do |name| type = String # TODO @model.property name.intern, type end end |
#uri ⇒ Object
62 63 64 |
# File 'lib/dm-ys/scraper.rb', line 62 def uri @uri || @model.uri.to_s.chomp('*') end |