Class: Appwrite::Models::Locale

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip:, country_code:, country:, continent_code:, continent:, eu:, currency:, city:, time_zone:, postal_code:, latitude:, longitude:, autonomous_system_number:, autonomous_system_organization:, isp:, connection_type:, connection_usage_type:, connection_organization:) ⇒ Locale

Returns a new instance of Locale.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/appwrite/models/locale.rb', line 25

def initialize(
    ip:,
    country_code:,
    country:,
    continent_code:,
    continent:,
    eu:,
    currency:,
    city: ,
    time_zone: ,
    postal_code: ,
    latitude: ,
    longitude: ,
    autonomous_system_number: ,
    autonomous_system_organization: ,
    isp: ,
    connection_type: ,
    connection_usage_type: ,
    connection_organization: 
)
    @ip = ip
    @country_code = country_code
    @country = country
    @continent_code = continent_code
    @continent = continent
    @eu = eu
    @currency = currency
    @city = city
    @time_zone = time_zone
    @postal_code = postal_code
    @latitude = latitude
    @longitude = longitude
    @autonomous_system_number = autonomous_system_number
    @autonomous_system_organization = autonomous_system_organization
    @isp = isp
    @connection_type = connection_type
    @connection_usage_type = connection_usage_type
    @connection_organization = connection_organization
end

Instance Attribute Details

#autonomous_system_numberObject (readonly)

Returns the value of attribute autonomous_system_number.



18
19
20
# File 'lib/appwrite/models/locale.rb', line 18

def autonomous_system_number
  @autonomous_system_number
end

#autonomous_system_organizationObject (readonly)

Returns the value of attribute autonomous_system_organization.



19
20
21
# File 'lib/appwrite/models/locale.rb', line 19

def autonomous_system_organization
  @autonomous_system_organization
end

#cityObject (readonly)

Returns the value of attribute city.



13
14
15
# File 'lib/appwrite/models/locale.rb', line 13

def city
  @city
end

#connection_organizationObject (readonly)

Returns the value of attribute connection_organization.



23
24
25
# File 'lib/appwrite/models/locale.rb', line 23

def connection_organization
  @connection_organization
end

#connection_typeObject (readonly)

Returns the value of attribute connection_type.



21
22
23
# File 'lib/appwrite/models/locale.rb', line 21

def connection_type
  @connection_type
end

#connection_usage_typeObject (readonly)

Returns the value of attribute connection_usage_type.



22
23
24
# File 'lib/appwrite/models/locale.rb', line 22

def connection_usage_type
  @connection_usage_type
end

#continentObject (readonly)

Returns the value of attribute continent.



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

def continent
  @continent
end

#continent_codeObject (readonly)

Returns the value of attribute continent_code.



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

def continent_code
  @continent_code
end

#countryObject (readonly)

Returns the value of attribute country.



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

def country
  @country
end

#country_codeObject (readonly)

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#currencyObject (readonly)

Returns the value of attribute currency.



12
13
14
# File 'lib/appwrite/models/locale.rb', line 12

def currency
  @currency
end

#euObject (readonly)

Returns the value of attribute eu.



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

def eu
  @eu
end

#ipObject (readonly)

Returns the value of attribute ip.



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

def ip
  @ip
end

#ispObject (readonly)

Returns the value of attribute isp.



20
21
22
# File 'lib/appwrite/models/locale.rb', line 20

def isp
  @isp
end

#latitudeObject (readonly)

Returns the value of attribute latitude.



16
17
18
# File 'lib/appwrite/models/locale.rb', line 16

def latitude
  @latitude
end

#longitudeObject (readonly)

Returns the value of attribute longitude.



17
18
19
# File 'lib/appwrite/models/locale.rb', line 17

def longitude
  @longitude
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



15
16
17
# File 'lib/appwrite/models/locale.rb', line 15

def postal_code
  @postal_code
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



14
15
16
# File 'lib/appwrite/models/locale.rb', line 14

def time_zone
  @time_zone
end

Class Method Details

.from(map:) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/appwrite/models/locale.rb', line 65

def self.from(map:)
    Locale.new(
        ip: map["ip"],
        country_code: map["countryCode"],
        country: map["country"],
        continent_code: map["continentCode"],
        continent: map["continent"],
        eu: map["eu"],
        currency: map["currency"],
        city: map["city"],
        time_zone: map["timeZone"],
        postal_code: map["postalCode"],
        latitude: map["latitude"],
        longitude: map["longitude"],
        autonomous_system_number: map["autonomousSystemNumber"],
        autonomous_system_organization: map["autonomousSystemOrganization"],
        isp: map["isp"],
        connection_type: map["connectionType"],
        connection_usage_type: map["connectionUsageType"],
        connection_organization: map["connectionOrganization"]
    )
end

Instance Method Details

#to_mapObject



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/appwrite/models/locale.rb', line 88

def to_map
    {
        "ip": @ip,
        "countryCode": @country_code,
        "country": @country,
        "continentCode": @continent_code,
        "continent": @continent,
        "eu": @eu,
        "currency": @currency,
        "city": @city,
        "timeZone": @time_zone,
        "postalCode": @postal_code,
        "latitude": @latitude,
        "longitude": @longitude,
        "autonomousSystemNumber": @autonomous_system_number,
        "autonomousSystemOrganization": @autonomous_system_organization,
        "isp": @isp,
        "connectionType": @connection_type,
        "connectionUsageType": @connection_usage_type,
        "connectionOrganization": @connection_organization
    }
end