Class: Appwrite::Models::Program

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, title:, description:, tag:, icon:, url:, active:, external:, billing_plan_id:) ⇒ Program

Returns a new instance of Program.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/appwrite/models/program.rb', line 16

def initialize(
    id:,
    title:,
    description:,
    tag:,
    icon:,
    url:,
    active:,
    external:,
    billing_plan_id:
)
    @id = id
    @title = title
    @description = description
    @tag = tag
    @icon = icon
    @url = url
    @active = active
    @external = external
    @billing_plan_id = billing_plan_id
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



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

def active
  @active
end

#billing_plan_idObject (readonly)

Returns the value of attribute billing_plan_id.



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

def billing_plan_id
  @billing_plan_id
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#externalObject (readonly)

Returns the value of attribute external.



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

def external
  @external
end

#iconObject (readonly)

Returns the value of attribute icon.



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

def icon
  @icon
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#tagObject (readonly)

Returns the value of attribute tag.



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

def tag
  @tag
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

Class Method Details

.from(map:) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/appwrite/models/program.rb', line 38

def self.from(map:)
    Program.new(
        id: map["$id"],
        title: map["title"],
        description: map["description"],
        tag: map["tag"],
        icon: map["icon"],
        url: map["url"],
        active: map["active"],
        external: map["external"],
        billing_plan_id: map["billingPlanId"]
    )
end

Instance Method Details

#to_mapObject



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/appwrite/models/program.rb', line 52

def to_map
    {
        "$id": @id,
        "title": @title,
        "description": @description,
        "tag": @tag,
        "icon": @icon,
        "url": @url,
        "active": @active,
        "external": @external,
        "billingPlanId": @billing_plan_id
    }
end