Class: Appwrite::Models::Block
- Inherits:
-
Object
- Object
- Appwrite::Models::Block
- Defined in:
- lib/appwrite/models/block.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#expired_at ⇒ Object
readonly
Returns the value of attribute expired_at.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#resource_id ⇒ Object
readonly
Returns the value of attribute resource_id.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, resource_type:, resource_id:, mode:, expired_at: nil) ⇒ Block
constructor
A new instance of Block.
- #to_map ⇒ Object
Constructor Details
#initialize(created_at:, resource_type:, resource_id:, mode:, expired_at: nil) ⇒ Block
Returns a new instance of Block.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/appwrite/models/block.rb', line 12 def initialize( created_at:, resource_type:, resource_id:, mode:, expired_at: nil ) @created_at = created_at @resource_type = resource_type @resource_id = resource_id @mode = mode @expired_at = expired_at end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/appwrite/models/block.rb', line 6 def created_at @created_at end |
#expired_at ⇒ Object (readonly)
Returns the value of attribute expired_at.
10 11 12 |
# File 'lib/appwrite/models/block.rb', line 10 def expired_at @expired_at end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
9 10 11 |
# File 'lib/appwrite/models/block.rb', line 9 def mode @mode end |
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
8 9 10 |
# File 'lib/appwrite/models/block.rb', line 8 def resource_id @resource_id end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
7 8 9 |
# File 'lib/appwrite/models/block.rb', line 7 def resource_type @resource_type end |
Class Method Details
.from(map:) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/appwrite/models/block.rb', line 26 def self.from(map:) map = { "$createdAt" => "", "resourceType" => "", "resourceId" => "", "mode" => "full" }.merge(map) Block.new( created_at: map["$createdAt"], resource_type: map["resourceType"], resource_id: map["resourceId"], mode: map["mode"], expired_at: map["expiredAt"] ) end |
Instance Method Details
#to_map ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/appwrite/models/block.rb', line 37 def to_map { "$createdAt": @created_at, "resourceType": @resource_type, "resourceId": @resource_id, "mode": @mode, "expiredAt": @expired_at } end |