Class: Appwrite::Models::Language

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, code:, native_name:) ⇒ Language

Returns a new instance of Language.



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

def initialize(
    name:,
    code:,
    native_name:
)
    @name = name
    @code = code
    @native_name = native_name
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#native_nameObject (readonly)

Returns the value of attribute native_name.



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

def native_name
  @native_name
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    Language.new(
        name: map["name"],
        code: map["code"],
        native_name: map["nativeName"]
    )
end

Instance Method Details

#to_mapObject



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

def to_map
    {
        "name": @name,
        "code": @code,
        "nativeName": @native_name
    }
end