Class: Appwrite::Models::ResourceToken
- Inherits:
-
Object
- Object
- Appwrite::Models::ResourceToken
- Defined in:
- lib/appwrite/models/resource_token.rb
Instance Attribute Summary collapse
-
#accessed_at ⇒ Object
readonly
Returns the value of attribute accessed_at.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#expire ⇒ Object
readonly
Returns the value of attribute expire.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#resource_id ⇒ Object
readonly
Returns the value of attribute resource_id.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, resource_id:, resource_type:, expire:, secret:, accessed_at:) ⇒ ResourceToken
constructor
A new instance of ResourceToken.
- #to_map ⇒ Object
Constructor Details
#initialize(id:, created_at:, resource_id:, resource_type:, expire:, secret:, accessed_at:) ⇒ ResourceToken
Returns a new instance of ResourceToken.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/appwrite/models/resource_token.rb', line 14 def initialize( id:, created_at:, resource_id:, resource_type:, expire:, secret:, accessed_at: ) @id = id @created_at = created_at @resource_id = resource_id @resource_type = resource_type @expire = expire @secret = secret @accessed_at = accessed_at end |
Instance Attribute Details
#accessed_at ⇒ Object (readonly)
Returns the value of attribute accessed_at.
12 13 14 |
# File 'lib/appwrite/models/resource_token.rb', line 12 def accessed_at @accessed_at end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/appwrite/models/resource_token.rb', line 7 def created_at @created_at end |
#expire ⇒ Object (readonly)
Returns the value of attribute expire.
10 11 12 |
# File 'lib/appwrite/models/resource_token.rb', line 10 def expire @expire end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/appwrite/models/resource_token.rb', line 6 def id @id end |
#resource_id ⇒ Object (readonly)
Returns the value of attribute resource_id.
8 9 10 |
# File 'lib/appwrite/models/resource_token.rb', line 8 def resource_id @resource_id end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
9 10 11 |
# File 'lib/appwrite/models/resource_token.rb', line 9 def resource_type @resource_type end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
11 12 13 |
# File 'lib/appwrite/models/resource_token.rb', line 11 def secret @secret end |
Class Method Details
.from(map:) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/appwrite/models/resource_token.rb', line 32 def self.from(map:) ResourceToken.new( id: map["$id"], created_at: map["$createdAt"], resource_id: map["resourceId"], resource_type: map["resourceType"], expire: map["expire"], secret: map["secret"], accessed_at: map["accessedAt"] ) end |
Instance Method Details
#to_map ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/appwrite/models/resource_token.rb', line 44 def to_map { "$id": @id, "$createdAt": @created_at, "resourceId": @resource_id, "resourceType": @resource_type, "expire": @expire, "secret": @secret, "accessedAt": @accessed_at } end |