Class: CatchNotes::Image
- Inherits:
-
Object
- Object
- CatchNotes::Image
- Defined in:
- lib/catch_notes/image.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the raw data of the image.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#destroy ⇒ Object
:nodoc:.
-
#destroy! ⇒ Object
:nodoc:.
-
#initialize(opts = {}) ⇒ Image
constructor
A new instance of Image.
Constructor Details
#initialize(opts = {}) ⇒ Image
Returns a new instance of Image.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/catch_notes/image.rb', line 6 def initialize(opts = {}) @attr = opts @url = nil @data = nil if opts[:url] init_from_url elsif opts[:file] init_from_file elsif opts[:data] init_from_data end end |
Instance Attribute Details
#data ⇒ Object
Returns the raw data of the image. If there is no data, it will be generated from the image at url if it is set.
33 34 35 |
# File 'lib/catch_notes/image.rb', line 33 def data @data end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/catch_notes/image.rb', line 4 def url @url end |
Instance Method Details
#destroy ⇒ Object
:nodoc:
61 62 63 64 65 |
# File 'lib/catch_notes/image.rb', line 61 def destroy #:nodoc: destroy! rescue false end |
#destroy! ⇒ Object
:nodoc:
58 59 |
# File 'lib/catch_notes/image.rb', line 58 def destroy! #:nodoc: end |