Class: Vectory::Image

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

Direct Known Subclasses

Datauri, Vector

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Image

Returns a new instance of Image.



19
20
21
# File 'lib/vectory/image.rb', line 19

def initialize(content)
  @content = content
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

Class Method Details

.from_content(content) ⇒ Object



12
13
14
# File 'lib/vectory/image.rb', line 12

def from_content(content)
  new(content)
end

.from_path(path) ⇒ Object



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

def from_path(path)
  new(File.read(path, mode: "rb"))
end