struct DynFork::Globals::Types::FileData
- DynFork::Globals::Types::FileData
- Struct
- Value
- Object
Overview
Data type for FileField.
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 file needs to be deleted: delete=true.
-
#delete? : Bool
If the file needs to be deleted: delete=true.
-
#name : String
Original file name.
-
#name=(name : String)
Original file name.
-
#path : String
Path to file.
-
#path=(path : String)
Path to file.
-
#size : Int64
File size in bytes.
-
#size=(size : Int64)
File size in bytes.
-
#to_bson(bson = BSON.new)
Converts to a BSON representation.
-
#url : String
URL to file.
-
#url=(url : String)
URL to file.
Constructor Detail
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)
Class Method Detail
Instance Method Detail
def delete=(delete : Bool)
#
If the file needs to be deleted: delete=true.
By default: delete=false.
def to_bson(bson = BSON.new)
#
Converts to a BSON representation.
user = User.new name: "John"
bson = user.to_bson