Class: Netfira::WebConnect::Models::Image
- Inherits:
-
Netfira::WebConnect::Model::Record::FileRecord
- Object
- ActiveRecord::Base
- Netfira::WebConnect::Model
- Netfira::WebConnect::Model::Record
- Netfira::WebConnect::Model::Record::FileRecord
- Netfira::WebConnect::Models::Image
- Defined in:
- lib/netfira/web_connect/models/image.rb
Defined Under Namespace
Classes: FocusPoint
Constant Summary
Constants included from Netfira::WebConnect::Model::Record::Serializer
Netfira::WebConnect::Model::Record::Serializer::EXCLUDE_FROM_SERIALIZE
Instance Method Summary collapse
- #data=(value) ⇒ Object
- #dimensions ⇒ Object
- #dimensions=(value) ⇒ Object
- #focus_point ⇒ Object
- #focus_point=(point) ⇒ Object
Methods inherited from Netfira::WebConnect::Model::Record::FileRecord
#<<, #attachment_file_name, #attachment_file_name=, #attachment_file_size, #attachment_file_size=, #checksum, #checksum=, #data, origin_key, table_name
Methods inherited from Netfira::WebConnect::Model::Record
#as_readonly, #as_readwrite, find_by_origin_id, find_or_create_by_origin_id, find_or_initialize_by_origin_id, has_file?, has_languages?, #origin_id, origin_key, related_classes, #reload, schema, sendable?, table_name, tree?, writable?, #write_with_type_casting
Methods included from Netfira::WebConnect::Model::Record::Materialization
Methods included from Netfira::WebConnect::Model::Record::Digests
Methods included from Netfira::WebConnect::Model::Record::Serializer
Methods included from Netfira::WebConnect::Model::Record::Relations
Methods inherited from Netfira::WebConnect::Model
#dispatch_event, plural_name, single_name, table_name
Instance Method Details
#data=(value) ⇒ Object
17 18 19 20 |
# File 'lib/netfira/web_connect/models/image.rb', line 17 def data=(value) super value self.width, self.height = FastImage.size(.staged_path) end |
#dimensions ⇒ Object
22 23 24 |
# File 'lib/netfira/web_connect/models/image.rb', line 22 def dimensions [width, height] end |
#dimensions=(value) ⇒ Object
26 27 28 |
# File 'lib/netfira/web_connect/models/image.rb', line 26 def dimensions=(value) self.width, self.height = value end |
#focus_point ⇒ Object
13 14 15 |
# File 'lib/netfira/web_connect/models/image.rb', line 13 def focus_point @focus_point ||= FocusPoint.new(self) end |
#focus_point=(point) ⇒ Object
7 8 9 10 11 |
# File 'lib/netfira/web_connect/models/image.rb', line 7 def focus_point=(point) self.focus_point_top = point[:top] self.focus_point_left = point[:left] self.focus_point end |