module Ckeditor::Orm::Base::AssetBase::InstanceMethods

Public Instance Methods

as_json(options = nil) click to toggle source
Calls superclass method
# File lib/ckeditor/orm/base.rb, line 40
def as_json(options = nil)
  options = {
    methods: as_json_methods,
    root: 'asset'
  }.merge!(options || {})

  super(options)
end
as_json_methods() click to toggle source
# File lib/ckeditor/orm/base.rb, line 36
def as_json_methods
  [:url_content, :url_thumb, :size, :filename, :format_created_at]
end
filename() click to toggle source
# File lib/ckeditor/orm/base.rb, line 8
def filename
  data_file_name
end
format_created_at() click to toggle source
# File lib/ckeditor/orm/base.rb, line 24
def format_created_at
  I18n.l(created_at, format: :short)
end
has_dimensions?() click to toggle source
# File lib/ckeditor/orm/base.rb, line 16
def has_dimensions?
  respond_to?(:width) && respond_to?(:height)
end
image?() click to toggle source
# File lib/ckeditor/orm/base.rb, line 20
def image?
  Ckeditor::IMAGE_TYPES.include?(data_content_type)
end
size() click to toggle source
# File lib/ckeditor/orm/base.rb, line 12
def size
  data_file_size
end
url_content() click to toggle source
# File lib/ckeditor/orm/base.rb, line 28
def url_content
  url
end
url_thumb() click to toggle source
# File lib/ckeditor/orm/base.rb, line 32
def url_thumb
  url(:thumb)
end