Class: Dragonfly::UrlAttributes
- Includes:
- HasFilename
- Defined in:
- lib/dragonfly/url_attributes.rb
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #extract(keys) ⇒ Object
-
#format ⇒ Object
Hack so we can use .send(‘format’) and it not call the private Kernel method.
Methods included from HasFilename
#basename, #basename=, #ext, #ext=
Instance Method Details
#empty? ⇒ Boolean
9 10 11 |
# File 'lib/dragonfly/url_attributes.rb', line 9 def empty? @table.reject{|k, v| v.nil? }.empty? end |
#extract(keys) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/dragonfly/url_attributes.rb', line 18 def extract(keys) keys.inject({}) do |attrs, key| value = send(key) attrs[key] = value unless Utils.blank?(value) attrs end end |
#format ⇒ Object
Hack so we can use .send(‘format’) and it not call the private Kernel method
14 15 16 |
# File 'lib/dragonfly/url_attributes.rb', line 14 def format @table[:format] end |