Module: RedactorRails::Orm::Base::AssetBase::InstanceMethods
- Defined in:
- lib/redactor-rails/orm/base.rb
Instance Method Summary collapse
- #as_json(options = nil) ⇒ Object
- #as_json_methods ⇒ Object
- #has_dimensions? ⇒ Boolean
- #image ⇒ Object
- #image? ⇒ Boolean
- #thumb ⇒ Object
Instance Method Details
#as_json(options = nil) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/redactor-rails/orm/base.rb', line 26 def as_json( = nil) = { :methods => as_json_methods, :root => false } super end |
#as_json_methods ⇒ Object
22 23 24 |
# File 'lib/redactor-rails/orm/base.rb', line 22 def as_json_methods [:image, :thumb] end |
#has_dimensions? ⇒ Boolean
6 7 8 |
# File 'lib/redactor-rails/orm/base.rb', line 6 def has_dimensions? respond_to?(:width) && respond_to?(:height) end |
#image ⇒ Object
14 15 16 |
# File 'lib/redactor-rails/orm/base.rb', line 14 def image url end |
#image? ⇒ Boolean
10 11 12 |
# File 'lib/redactor-rails/orm/base.rb', line 10 def image? RedactorRails::IMAGE_TYPES.include?(data_content_type) end |
#thumb ⇒ Object
18 19 20 |
# File 'lib/redactor-rails/orm/base.rb', line 18 def thumb url(:thumb) end |