Class: Appwrite::Models::Currency

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol:, name:, symbol_native:, decimal_digits:, rounding:, code:, name_plural:) ⇒ Currency

Returns a new instance of Currency.



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

def initialize(
    symbol:,
    name:,
    symbol_native:,
    decimal_digits:,
    rounding:,
    code:,
    name_plural:
)
    @symbol = symbol
    @name = name
    @symbol_native = symbol_native
    @decimal_digits = decimal_digits
    @rounding = rounding
    @code = code
    @name_plural = name_plural
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#decimal_digitsObject (readonly)

Returns the value of attribute decimal_digits.



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

def decimal_digits
  @decimal_digits
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#name_pluralObject (readonly)

Returns the value of attribute name_plural.



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

def name_plural
  @name_plural
end

#roundingObject (readonly)

Returns the value of attribute rounding.



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

def rounding
  @rounding
end

#symbolObject (readonly)

Returns the value of attribute symbol.



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

def symbol
  @symbol
end

#symbol_nativeObject (readonly)

Returns the value of attribute symbol_native.



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

def symbol_native
  @symbol_native
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    Currency.new(
        symbol: map["symbol"],
        name: map["name"],
        symbol_native: map["symbolNative"],
        decimal_digits: map["decimalDigits"],
        rounding: map["rounding"],
        code: map["code"],
        name_plural: map["namePlural"]
    )
end

Instance Method Details

#to_mapObject



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

def to_map
    {
        "symbol": @symbol,
        "name": @name,
        "symbolNative": @symbol_native,
        "decimalDigits": @decimal_digits,
        "rounding": @rounding,
        "code": @code,
        "namePlural": @name_plural
    }
end