Class: MxHero::API::Group

Inherits:
Struct
  • Object
show all
Defined in:
lib/resources/group.rb

Overview

A group instance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elements) ⇒ Group

Returns a new instance of Group.



6
7
8
# File 'lib/resources/group.rb', line 6

def initialize(elements)
  elements.each { |prop, value| send("#{prop}=", value) if respond_to?("#{prop}") }
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



5
6
7
# File 'lib/resources/group.rb', line 5

def description
  @description
end

#domainObject

Returns the value of attribute domain

Returns:

  • (Object)

    the current value of domain



5
6
7
# File 'lib/resources/group.rb', line 5

def domain
  @domain
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/resources/group.rb', line 5

def name
  @name
end

Instance Method Details

#to_json(*args) ⇒ Object



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

def to_json(*args)
  { name: name, domain: domain, description: description }.to_json(*args)
end