struct DynFork::Globals::Types::ImageData

Overview

Data type for ImageField.

Included Modules

Defined in:

dynfork/globals/types.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(bson : BSON) #

Allocate an instance and copies data from a BSON struct.

class User
  include BSON::Serializable
  property name : String
end

data = BSON.new
data["name"] = "John"
User.new(data)

[View source]
def self.new #

[View source]

Class Method Detail

def self.from_bson(bson : BSON) #

NOTE See self.new.


[View source]

Instance Method Detail

def delete=(delete : Bool) #

If the images needs to be deleted: delete=true.
By default: delete=false.


[View source]
def delete? : Bool #

If the images needs to be deleted: delete=true.
By default: delete=false.


[View source]
def extension : String #

Image extension.
Examples: .png|.jpeg|.jpg|.webp


[View source]
def extension=(extension : String) #

Image extension.
Examples: .png|.jpeg|.jpg|.webp


[View source]
def height : Int32 #

Image height in pixels (for original image).


[View source]
def height=(height : Int32) #

Image height in pixels (for original image).


[View source]
def images_dir_path : String | Nil #

Path to target directory with images.


def images_dir_path=(images_dir_path : String | Nil) #

Path to target directory with images.


[View source]
def images_dir_path? : String | Nil | Nil #

Path to target directory with images.


def images_dir_url : String | Nil #

URL path to target directory with images.


def images_dir_url=(images_dir_url : String | Nil) #

URL path to target directory with images.


[View source]
def images_dir_url? : String | Nil | Nil #

URL path to target directory with images.


def name : String #

Image name (for original image).


[View source]
def name=(name : String) #

Image name (for original image).


[View source]
def path : String #

Path to image (for original image).


[View source]
def path=(path : String) #

Path to image (for original image).


[View source]
def path_lg : String #

[View source]
def path_lg=(path_lg : String) #

[View source]
def path_md : String #

[View source]
def path_md=(path_md : String) #

[View source]
def path_sm : String #

[View source]
def path_sm=(path_sm : String) #

[View source]
def path_xs : String #

For thumbnails.


[View source]
def path_xs=(path_xs : String) #

For thumbnails.


[View source]
def size : Int64 #

Image size in bytes (for original image).


[View source]
def size=(size : Int64) #

Image size in bytes (for original image).


[View source]
def to_bson(bson = BSON.new) #

Converts to a BSON representation.

user = User.new name: "John"
bson = user.to_bson

[View source]
def url : String #

URL to the image (for original image).


[View source]
def url=(url : String) #

URL to the image (for original image).


[View source]
def url_lg : String #

[View source]
def url_lg=(url_lg : String) #

[View source]
def url_md : String #

[View source]
def url_md=(url_md : String) #

[View source]
def url_sm : String #

[View source]
def url_sm=(url_sm : String) #

[View source]
def url_xs : String #

For thumbnails.


[View source]
def url_xs=(url_xs : String) #

For thumbnails.


[View source]
def width : Int32 #

Image width in pixels (for original image).


[View source]
def width=(width : Int32) #

Image width in pixels (for original image).


[View source]