Class: Unit::UnitResource

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/unit_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, type, attributes, relationships) ⇒ UnitResource

Returns a new instance of UnitResource.

Parameters:

  • id (String)

    The resource’s ID

  • type (String)

    The type of the resource

  • attributes (Hash)

    The attributes

  • relationships (Hash)

    The relationships



13
14
15
16
17
18
# File 'lib/unit/models/unit_resource.rb', line 13

def initialize(id, type, attributes, relationships)
  @id = id
  @type = type
  @attributes = attributes
  @relationships = relationships
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



7
8
9
# File 'lib/unit/models/unit_resource.rb', line 7

def attributes
  @attributes
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/unit/models/unit_resource.rb', line 7

def id
  @id
end

#relationshipsObject (readonly)

Returns the value of attribute relationships.



7
8
9
# File 'lib/unit/models/unit_resource.rb', line 7

def relationships
  @relationships
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/unit/models/unit_resource.rb', line 7

def type
  @type
end