Class: OpenPanel::SDK::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/openpanel/sdk/group.rb

Overview

Group payload class. Use this class to create or update a group in OpenPanel.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, type: nil, name: nil, properties: {}) ⇒ Group

Returns a new instance of Group.



13
14
15
16
17
18
# File 'lib/openpanel/sdk/group.rb', line 13

def initialize(id: nil, type: nil, name: nil, properties: {})
  @id = id
  @type = type
  @name = name
  @properties = properties
end

Instance Attribute Details

#idString

group ID

Returns:

  • (String)

    the current value of id



10
11
12
# File 'lib/openpanel/sdk/group.rb', line 10

def id
  @id
end

#nameString

group name

Returns:

  • (String)

    the current value of name



10
11
12
# File 'lib/openpanel/sdk/group.rb', line 10

def name
  @name
end

#propertiesHash

group properties

Returns:

  • (Hash)

    the current value of properties



10
11
12
# File 'lib/openpanel/sdk/group.rb', line 10

def properties
  @properties
end

#typeString

group type (e.g. ‘company’, ‘team’)

Returns:

  • (String)

    the current value of type



10
11
12
# File 'lib/openpanel/sdk/group.rb', line 10

def type
  @type
end

Instance Method Details

#to_json(*_args) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/openpanel/sdk/group.rb', line 20

def to_json(*_args)
  {
    id: id,
    type: type,
    name: name,
    properties: properties
  }.to_json
end