Class: OpenTopo::Net::Response::Headers

Inherits:
Struct
  • Object
show all
Defined in:
lib/open_topo/net/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_dispositionObject

Returns the value of attribute content_disposition

Returns:

  • (Object)

    the current value of content_disposition



11
12
13
# File 'lib/open_topo/net/response.rb', line 11

def content_disposition
  @content_disposition
end

#content_lengthObject

Returns the value of attribute content_length

Returns:

  • (Object)

    the current value of content_length



11
12
13
# File 'lib/open_topo/net/response.rb', line 11

def content_length
  @content_length
end

#content_typeObject

Returns the value of attribute content_type

Returns:

  • (Object)

    the current value of content_type



11
12
13
# File 'lib/open_topo/net/response.rb', line 11

def content_type
  @content_type
end

#dateObject

Returns the value of attribute date

Returns:

  • (Object)

    the current value of date



11
12
13
# File 'lib/open_topo/net/response.rb', line 11

def date
  @date
end

Instance Method Details

#filenameObject



12
13
14
15
16
17
18
# File 'lib/open_topo/net/response.rb', line 12

def filename
  if content_disposition.nil? || !content_disposition.match?(filename_header)
    return nil
  end

  File.basename(content_disposition.split(filename_header).last.delete('"'), ".*")
end