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 47
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 43
def as_json_methods
  [:url, :url_content, :url_thumb, :size, :filename, :fileName, :format_created_at, :uploaded]
end
fileName() click to toggle source
# File lib/ckeditor/orm/base.rb, line 11
def fileName
  filename
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 27
def format_created_at
  I18n.l(created_at, format: :short)
end
has_dimensions?() click to toggle source
# File lib/ckeditor/orm/base.rb, line 19
def has_dimensions?
  respond_to?(:width) && respond_to?(:height)
end
image?() click to toggle source
# File lib/ckeditor/orm/base.rb, line 23
def image?
  Ckeditor::IMAGE_TYPES.include?(data_content_type)
end
size() click to toggle source
# File lib/ckeditor/orm/base.rb, line 15
def size
  data_file_size
end
uploaded() click to toggle source
# File lib/ckeditor/orm/base.rb, line 39
def uploaded
  1
end
url_content() click to toggle source
# File lib/ckeditor/orm/base.rb, line 31
def url_content
  url
end
url_thumb() click to toggle source
# File lib/ckeditor/orm/base.rb, line 35
def url_thumb
  url(:thumb)
end