Class: FacebookScraper::Status
- Inherits:
-
Object
- Object
- FacebookScraper::Status
- Defined in:
- lib/facebook_scraper/status.rb
Constant Summary collapse
- VALID_STATUS =
[:success, :failed]
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(status, error = nil) ⇒ Status
constructor
A new instance of Status.
- #success? ⇒ Boolean
Constructor Details
#initialize(status, error = nil) ⇒ Status
Returns a new instance of Status.
7 8 9 10 11 12 |
# File 'lib/facebook_scraper/status.rb', line 7 def initialize(status, error = nil) fail ArgumentError unless VALID_STATUS.include?(status) @status = status @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/facebook_scraper/status.rb', line 5 def error @error end |
Instance Method Details
#failed? ⇒ Boolean
18 19 20 |
# File 'lib/facebook_scraper/status.rb', line 18 def failed? @status == :failed end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/facebook_scraper/status.rb', line 14 def success? @status == :success end |