Class: Aranha::Address
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Aranha::Address
show all
- Includes:
- Processor, Scheduling, EacRailsUtils::Models::InequalityQueries
- Defined in:
- app/models/aranha/address.rb,
app/models/aranha/address/processor.rb,
app/models/aranha/address/scheduling.rb,
app/models/aranha/address/delayed_job.rb
Defined Under Namespace
Modules: Processor, Scheduling
Classes: DelayedJob
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Scheduling
#allow_retry?, #check_scheduling, #expired?, #init_scheduling, #schedule?
Methods included from Processor
#processor_configuration
Class Method Details
.sanitize_url(url) ⇒ Object
15
16
17
18
19
20
21
|
# File 'app/models/aranha/address.rb', line 15
def sanitize_url(url)
if url.is_a?(Hash)
::EacRubyUtils::Yaml.dump(url)
else
url.to_s
end
end
|
Instance Method Details
#process ⇒ Object
40
41
42
43
44
45
46
|
# File 'app/models/aranha/address.rb', line 40
def process
ActiveRecord::Base.transaction do
instanciate_processor.process
self.processed_at = Time.zone.now
save!
end
end
|
#processed? ⇒ Boolean
48
49
50
|
# File 'app/models/aranha/address.rb', line 48
def processed?
processed_at.present?
end
|
#to_s ⇒ Object
36
37
38
|
# File 'app/models/aranha/address.rb', line 36
def to_s
"#{processor}|#{url}"
end
|