Class: Appwrite::Models::Topic
- Inherits:
-
Object
- Object
- Appwrite::Models::Topic
- Defined in:
- lib/appwrite/models/topic.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#email_total ⇒ Object
readonly
Returns the value of attribute email_total.
-
#expiry ⇒ Object
readonly
Returns the value of attribute expiry.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#push_total ⇒ Object
readonly
Returns the value of attribute push_total.
-
#qos ⇒ Object
readonly
Returns the value of attribute qos.
-
#sms_total ⇒ Object
readonly
Returns the value of attribute sms_total.
-
#subscribe ⇒ Object
readonly
Returns the value of attribute subscribe.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, updated_at:, name:, description:, email_total:, sms_total:, push_total:, subscribe:, qos: nil, expiry: nil) ⇒ Topic
constructor
A new instance of Topic.
- #to_map ⇒ Object
Constructor Details
#initialize(id:, created_at:, updated_at:, name:, description:, email_total:, sms_total:, push_total:, subscribe:, qos: nil, expiry: nil) ⇒ Topic
Returns a new instance of Topic.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/appwrite/models/topic.rb', line 18 def initialize( id:, created_at:, updated_at:, name:, description:, email_total:, sms_total:, push_total:, subscribe:, qos: nil, expiry: nil ) @id = id @created_at = created_at @updated_at = updated_at @name = name @description = description @email_total = email_total @sms_total = sms_total @push_total = push_total @subscribe = subscribe @qos = qos @expiry = expiry end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/appwrite/models/topic.rb', line 7 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/appwrite/models/topic.rb', line 10 def description @description end |
#email_total ⇒ Object (readonly)
Returns the value of attribute email_total.
11 12 13 |
# File 'lib/appwrite/models/topic.rb', line 11 def email_total @email_total end |
#expiry ⇒ Object (readonly)
Returns the value of attribute expiry.
16 17 18 |
# File 'lib/appwrite/models/topic.rb', line 16 def expiry @expiry end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/appwrite/models/topic.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/appwrite/models/topic.rb', line 9 def name @name end |
#push_total ⇒ Object (readonly)
Returns the value of attribute push_total.
13 14 15 |
# File 'lib/appwrite/models/topic.rb', line 13 def push_total @push_total end |
#qos ⇒ Object (readonly)
Returns the value of attribute qos.
15 16 17 |
# File 'lib/appwrite/models/topic.rb', line 15 def qos @qos end |
#sms_total ⇒ Object (readonly)
Returns the value of attribute sms_total.
12 13 14 |
# File 'lib/appwrite/models/topic.rb', line 12 def sms_total @sms_total end |
#subscribe ⇒ Object (readonly)
Returns the value of attribute subscribe.
14 15 16 |
# File 'lib/appwrite/models/topic.rb', line 14 def subscribe @subscribe end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
8 9 10 |
# File 'lib/appwrite/models/topic.rb', line 8 def updated_at @updated_at end |
Class Method Details
.from(map:) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/appwrite/models/topic.rb', line 44 def self.from(map:) map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "name" => "", "description" => "", "emailTotal" => 0, "smsTotal" => 0, "pushTotal" => 0, "subscribe" => ["users"] }.merge(map) Topic.new( id: map["$id"], created_at: map["$createdAt"], updated_at: map["$updatedAt"], name: map["name"], description: map["description"], email_total: map["emailTotal"], sms_total: map["smsTotal"], push_total: map["pushTotal"], subscribe: map["subscribe"], qos: map["qos"], expiry: map["expiry"] ) end |
Instance Method Details
#to_map ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/appwrite/models/topic.rb', line 61 def to_map { "$id": @id, "$createdAt": @created_at, "$updatedAt": @updated_at, "name": @name, "description": @description, "emailTotal": @email_total, "smsTotal": @sms_total, "pushTotal": @push_total, "subscribe": @subscribe, "qos": @qos, "expiry": @expiry } end |