Class: ShareCount::Base
- Inherits:
-
Object
- Object
- ShareCount::Base
- Includes:
- StringHelper
- Defined in:
- lib/share_count/base.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
3
- DEFAULT_OPEN_TIMEOUT =
3
- @@config =
{}
Instance Attribute Summary collapse
-
#checked_url ⇒ Object
Returns the value of attribute checked_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(checked_url) ⇒ Base
constructor
A new instance of Base.
- #shares ⇒ Object
- #shares! ⇒ Object
Methods included from StringHelper
#to_camel_case, #to_underscore
Constructor Details
#initialize(checked_url) ⇒ Base
Returns a new instance of Base.
17 18 19 20 |
# File 'lib/share_count/base.rb', line 17 def initialize(checked_url) # remove URI fragment @checked_url = checked_url.gsub(/#.+$/, '') end |
Instance Attribute Details
#checked_url ⇒ Object
Returns the value of attribute checked_url.
15 16 17 |
# File 'lib/share_count/base.rb', line 15 def checked_url @checked_url end |
Class Method Details
.config=(val) ⇒ Object
10 11 12 |
# File 'lib/share_count/base.rb', line 10 def config=(val) @@config = val end |
Instance Method Details
#shares ⇒ Object
22 23 24 25 26 27 |
# File 'lib/share_count/base.rb', line 22 def shares shares! rescue => e puts "[#{self.class.name}] Error during requesting sharings of '#{checked_url}': #{e}" nil end |
#shares! ⇒ Object
29 30 31 |
# File 'lib/share_count/base.rb', line 29 def shares! raise NotImplementedError end |