Class: Subjoin::Identifier

Inherits:
Object
  • Object
show all
Includes:
Metable
Defined in:
lib/subjoin/identifier.rb

Overview

A resource identifier object

Instance Attribute Summary collapse

Attributes included from Metable

#meta

Instance Method Summary collapse

Methods included from Metable

#has_meta?, #load_meta

Constructor Details

#initialize(type, id, meta = nil) ⇒ Identifier

Returns a new instance of Identifier.



10
11
12
13
14
15
# File 'lib/subjoin/identifier.rb', line 10

def initialize(type, id, meta=nil)
  #load_key(data)
  @type = type
  @id = id
  @meta = load_meta(meta)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/subjoin/identifier.rb', line 8

def id
  @id
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/subjoin/identifier.rb', line 7

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object

Test for equality. Two Ideintifers are considered equal if they have the same type and id



19
20
21
# File 'lib/subjoin/identifier.rb', line 19

def ==(other)
  return @type == other.type && @id == other.id
end