Class: Appwrite::Models::Phone

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code:, country_code:, country_name:) ⇒ Phone

Returns a new instance of Phone.



10
11
12
13
14
15
16
17
18
# File 'lib/appwrite/models/phone.rb', line 10

def initialize(
    code:,
    country_code:,
    country_name:
)
    @code = code
    @country_code = country_code
    @country_name = country_name
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#country_nameObject (readonly)

Returns the value of attribute country_name.



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

def country_name
  @country_name
end

Class Method Details

.from(map:) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/appwrite/models/phone.rb', line 20

def self.from(map:)
    Phone.new(
        code: map["code"],
        country_code: map["countryCode"],
        country_name: map["countryName"]
    )
end

Instance Method Details

#to_mapObject



28
29
30
31
32
33
34
# File 'lib/appwrite/models/phone.rb', line 28

def to_map
    {
        "code": @code,
        "countryCode": @country_code,
        "countryName": @country_name
    }
end