Class: Dragonfly::UrlAttributes

Inherits:
OpenStruct
  • Object
show all
Includes:
HasFilename
Defined in:
lib/dragonfly/url_attributes.rb

Instance Method Summary collapse

Methods included from HasFilename

#basename, #basename=, #ext, #ext=

Instance Method Details

#empty?Boolean

Returns:

  • (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

#formatObject

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