Class: ForestAdminDatasourceToolkit::Components::Caller

Inherits:
Object
  • Object
show all
Defined in:
lib/forest_admin_datasource_toolkit/components/caller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, email:, first_name:, last_name:, team:, rendering_id:, tags:, timezone:, permission_level:, role: nil, request: {}, project: nil, environment: nil, **_extra_args) ⇒ Caller

Returns a new instance of Caller.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 6

def initialize(
  id:,
  email:,
  first_name:,
  last_name:,
  team:,
  rendering_id:,
  tags:,
  timezone:,
  permission_level:,
  role: nil,
  request: {},
  project: nil,
  environment: nil,
  **_extra_args
)
  @id = id
  @email = email
  @first_name = first_name
  @last_name = last_name
  @team = team
  @rendering_id = rendering_id
  @tags = tags
  @timezone = timezone
  @permission_level = permission_level
  @role = role
  @request = request
  @project = project
  @environment = environment
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def first_name
  @first_name
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def id
  @id
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def last_name
  @last_name
end

#permission_levelObject (readonly)

Returns the value of attribute permission_level.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def permission_level
  @permission_level
end

#rendering_idObject (readonly)

Returns the value of attribute rendering_id.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def rendering_id
  @rendering_id
end

#roleObject (readonly)

Returns the value of attribute role.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def role
  @role
end

#tagsObject (readonly)

Returns the value of attribute tags.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def tags
  @tags
end

#teamObject (readonly)

Returns the value of attribute team.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def team
  @team
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



4
5
6
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 4

def timezone
  @timezone
end

Instance Method Details

#to_hObject



37
38
39
40
41
42
43
44
# File 'lib/forest_admin_datasource_toolkit/components/caller.rb', line 37

def to_h
  result = {}
  instance_variables.each do |attribute|
    result[attribute.to_s.delete('@').to_sym] = instance_variable_get(attribute)
  end

  result
end