Class: Shrinker::Extractor
- Inherits:
-
Struct
- Object
- Struct
- Shrinker::Extractor
- Defined in:
- lib/shrinker/extractor.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
writeonly
Sets the attribute config.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#config=(value) ⇒ Object
Sets the attribute config
2 3 4 |
# File 'lib/shrinker/extractor.rb', line 2 def config=(value) @config = value end |
#token ⇒ Object
Returns the value of attribute token
2 3 4 |
# File 'lib/shrinker/extractor.rb', line 2 def token @token end |
Class Method Details
.unshrink(token, config = nil) ⇒ Object
3 4 5 |
# File 'lib/shrinker/extractor.rb', line 3 def self.unshrink(token, config = nil) self.new(token, config).unshrink end |
Instance Method Details
#unshrink ⇒ Object
7 8 9 10 11 12 |
# File 'lib/shrinker/extractor.rb', line 7 def unshrink stored_content = backend.fetch(token) raise UrlNotFound.new("Cannot find the url with token: #{token}") if stored_content == {} EasyUrl.new(stored_content['url'], stored_content['attributes'] || {}) end |