Class: Smithy::Image
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Smithy::Image
- Includes:
- ContentBlocks::Model
- Defined in:
- app/models/smithy/image.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.content_block_description ⇒ Object
10 11 12 |
# File 'app/models/smithy/image.rb', line 10 def content_block_description "Images are primarily used for adding image-based content to your pages" end |
.image_scaling_options ⇒ Object
14 15 16 17 18 19 |
# File 'app/models/smithy/image.rb', line 14 def [ ['Keep to Scale', ''], ['Force Exact Dimensions (this may crop the image)', '#'] ] end |
Instance Method Details
#formatted_content ⇒ Object
22 23 24 |
# File 'app/models/smithy/image.rb', line 22 def formatted_content @formatted_content ||= markdown_formatter.render end |
#to_liquid ⇒ Object
26 27 28 29 30 31 |
# File 'app/models/smithy/image.rb', line 26 def to_liquid attributes.tap do |a| a['asset'] = asset.to_liquid if asset.present? a['formatted_content'] = formatted_content end end |