Class: Imagery::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/imagery/image.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Image) initialize(server, path)

A new instance of Image



12
13
14
15
16
# File 'lib/imagery/image.rb', line 12

def initialize(server, path)
  @server = server
  @path = path
  download(path)
end

Instance Attribute Details

- (Object) content

Returns the value of attribute content



7
8
9
# File 'lib/imagery/image.rb', line 7

def content
  @content
end

- (Object) headers (readonly)

Returns the value of attribute headers



8
9
10
# File 'lib/imagery/image.rb', line 8

def headers
  @headers
end

- (Object) server (readonly)

Returns the value of attribute server



10
11
12
# File 'lib/imagery/image.rb', line 10

def server
  @server
end

- (Object) status (readonly)

Returns the value of attribute status



9
10
11
# File 'lib/imagery/image.rb', line 9

def status
  @status
end

Instance Method Details

- (Object) basename



22
23
24
# File 'lib/imagery/image.rb', line 22

def basename
  File.basename(@path)
end

- (Object) basename_no_ext



26
27
28
# File 'lib/imagery/image.rb', line 26

def basename_no_ext
  File.basename(@path, ext)
end

- (Object) dirname



34
35
36
# File 'lib/imagery/image.rb', line 34

def dirname
  File.dirname(@path)
end

- (Object) ext



30
31
32
# File 'lib/imagery/image.rb', line 30

def ext
  File.extname(@path)
end

- (Boolean) found?

Returns:

  • (Boolean)


18
19
20
# File 'lib/imagery/image.rb', line 18

def found?
  @status == 200
end