struct DynFork::Globals::Types::ImageData
- DynFork::Globals::Types::ImageData
- Struct
- Value
- Object
Overview
Data type for ImageField.
Included Modules
- BSON::Serializable
- JSON::Serializable
Defined in:
dynfork/globals/types.crConstructors
- .new(pull : JSON::PullParser)
-
.new(bson : BSON)
Allocate an instance and copies data from a BSON struct.
- .new
Class Method Summary
-
.from_bson(bson : BSON)
NOTE See
self.new
.
Instance Method Summary
-
#delete=(delete : Bool)
If the images needs to be deleted: delete=true.
-
#delete? : Bool
If the images needs to be deleted: delete=true.
-
#extension : String
Image extension.
-
#extension=(extension : String)
Image extension.
-
#height : Int32
Image height in pixels (for original image).
-
#height=(height : Int32)
Image height in pixels (for original image).
-
#images_dir_path : String | Nil
Path to target directory with images.
-
#images_dir_path=(images_dir_path : String | Nil)
Path to target directory with images.
-
#images_dir_path? : String | Nil | Nil
Path to target directory with images.
-
#images_dir_url : String | Nil
URL path to target directory with images.
-
#images_dir_url=(images_dir_url : String | Nil)
URL path to target directory with images.
-
#images_dir_url? : String | Nil | Nil
URL path to target directory with images.
-
#name : String
Image name (for original image).
-
#name=(name : String)
Image name (for original image).
-
#path : String
Path to image (for original image).
-
#path=(path : String)
Path to image (for original image).
- #path_lg : String
- #path_lg=(path_lg : String)
- #path_md : String
- #path_md=(path_md : String)
- #path_sm : String
- #path_sm=(path_sm : String)
-
#path_xs : String
For thumbnails.
-
#path_xs=(path_xs : String)
For thumbnails.
-
#size : Int64
Image size in bytes (for original image).
-
#size=(size : Int64)
Image size in bytes (for original image).
-
#to_bson(bson = BSON.new)
Converts to a BSON representation.
-
#url : String
URL to the image (for original image).
-
#url=(url : String)
URL to the image (for original image).
- #url_lg : String
- #url_lg=(url_lg : String)
- #url_md : String
- #url_md=(url_md : String)
- #url_sm : String
- #url_sm=(url_sm : String)
-
#url_xs : String
For thumbnails.
-
#url_xs=(url_xs : String)
For thumbnails.
-
#width : Int32
Image width in pixels (for original image).
-
#width=(width : Int32)
Image width in pixels (for original image).
Constructor Detail
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)
Class Method Detail
Instance Method Detail
If the images needs to be deleted: delete=true.
By default: delete=false.
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson