Class: Appwrite::Models::HealthCertificate

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/models/health_certificate.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, subject_sn:, issuer_organisation:, valid_from:, valid_to:, signature_type_sn:) ⇒ HealthCertificate

Returns a new instance of HealthCertificate.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/appwrite/models/health_certificate.rb', line 13

def initialize(
    name:,
    subject_sn:,
    issuer_organisation:,
    valid_from:,
    valid_to:,
    signature_type_sn:
)
    @name = name
    @subject_sn = subject_sn
    @issuer_organisation = issuer_organisation
    @valid_from = valid_from
    @valid_to = valid_to
    @signature_type_sn = signature_type_sn
end

Instance Attribute Details

#issuer_organisationObject (readonly)

Returns the value of attribute issuer_organisation.



8
9
10
# File 'lib/appwrite/models/health_certificate.rb', line 8

def issuer_organisation
  @issuer_organisation
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/appwrite/models/health_certificate.rb', line 6

def name
  @name
end

#signature_type_snObject (readonly)

Returns the value of attribute signature_type_sn.



11
12
13
# File 'lib/appwrite/models/health_certificate.rb', line 11

def signature_type_sn
  @signature_type_sn
end

#subject_snObject (readonly)

Returns the value of attribute subject_sn.



7
8
9
# File 'lib/appwrite/models/health_certificate.rb', line 7

def subject_sn
  @subject_sn
end

#valid_fromObject (readonly)

Returns the value of attribute valid_from.



9
10
11
# File 'lib/appwrite/models/health_certificate.rb', line 9

def valid_from
  @valid_from
end

#valid_toObject (readonly)

Returns the value of attribute valid_to.



10
11
12
# File 'lib/appwrite/models/health_certificate.rb', line 10

def valid_to
  @valid_to
end

Class Method Details

.from(map:) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/appwrite/models/health_certificate.rb', line 29

def self.from(map:)
    HealthCertificate.new(
        name: map["name"],
        subject_sn: map["subjectSN"],
        issuer_organisation: map["issuerOrganisation"],
        valid_from: map["validFrom"],
        valid_to: map["validTo"],
        signature_type_sn: map["signatureTypeSN"]
    )
end

Instance Method Details

#to_mapObject



40
41
42
43
44
45
46
47
48
49
# File 'lib/appwrite/models/health_certificate.rb', line 40

def to_map
    {
        "name": @name,
        "subjectSN": @subject_sn,
        "issuerOrganisation": @issuer_organisation,
        "validFrom": @valid_from,
        "validTo": @valid_to,
        "signatureTypeSN": @signature_type_sn
    }
end