Class: Vectory::Image
- Inherits:
-
Object
- Object
- Vectory::Image
- Defined in:
- lib/vectory/image.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(content) ⇒ Image
constructor
A new instance of Image.
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
#content ⇒ Object
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 |