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:) ⇒ Locale

Returns a new instance of Locale.



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

def initialize(
    ip:,
    country_code:,
    country:,
    continent_code:,
    continent:,
    eu:,
    currency:
)
    @ip = ip
    @country_code = country_code
    @country = country
    @continent_code = continent_code
    @continent = continent
    @eu = eu
    @currency = currency
end

Instance Attribute Details

#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

Class Method Details

.from(map:) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/appwrite/models/locale.rb', line 32

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"]
    )
end

Instance Method Details

#to_mapObject



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/appwrite/models/locale.rb', line 44

def to_map
    {
        "ip": @ip,
        "countryCode": @country_code,
        "country": @country,
        "continentCode": @continent_code,
        "continent": @continent,
        "eu": @eu,
        "currency": @currency
    }
end