Class: Sass::Images::Image

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Image

Returns a new instance of Image.



5
6
7
# File 'lib/sass/images/image.rb', line 5

def initialize(path)
  @path = path.to_s
end

Instance Method Details

#base64Object



17
18
19
# File 'lib/sass/images/image.rb', line 17

def base64
  Base64.encode64(File.read(@path)).gsub("\n", '')
end

#content_typeObject



21
22
23
# File 'lib/sass/images/image.rb', line 21

def content_type
  MIME::Types.type_for(@path)[0].content_type.force_encoding 'UTF-8'
end

#heightObject



13
14
15
# File 'lib/sass/images/image.rb', line 13

def height
  [:height]
end

#widthObject



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

def width
  [:width]
end