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 38 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 34 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 6 def filename data_file_name end
format_created_at()
click to toggle source
# File lib/ckeditor/orm/base.rb, line 22 def format_created_at self.created_at.strftime("%d.%m.%Y") end
has_dimensions?()
click to toggle source
# File lib/ckeditor/orm/base.rb, line 14 def has_dimensions? respond_to?(:width) && respond_to?(:height) end
image?()
click to toggle source
# File lib/ckeditor/orm/base.rb, line 18 def image? Ckeditor::IMAGE_TYPES.include?(data_content_type) end
size()
click to toggle source
# File lib/ckeditor/orm/base.rb, line 10 def size data_file_size end
url_content()
click to toggle source
# File lib/ckeditor/orm/base.rb, line 26 def url_content url end
url_thumb()
click to toggle source
# File lib/ckeditor/orm/base.rb, line 30 def url_thumb url(:thumb) end