Class: BestImage::ImageReference

Inherits:
Object
  • Object
show all
Defined in:
lib/best_image/image_reference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ ImageReference

Returns a new instance of ImageReference.



6
7
8
9
# File 'lib/best_image/image_reference.rb', line 6

def initialize(url)
  @errors = []
  @url = url
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/best_image/image_reference.rb', line 3

def errors
  @errors
end

#urlObject (readonly)

Returns the value of attribute url.



4
5
6
# File 'lib/best_image/image_reference.rb', line 4

def url
  @url
end

Instance Method Details

#<=>(other) ⇒ Object



15
16
17
# File 'lib/best_image/image_reference.rb', line 15

def <=>(other)
  self.size <=> other.size
end

#sizeObject



11
12
13
# File 'lib/best_image/image_reference.rb', line 11

def size
  @size ||= calculate_file_size
end