Class: GOM::Object::Draft

Inherits:
Object
  • Object
show all
Defined in:
lib/gom/object/draft.rb

Overview

A draft for an object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object_id = nil, class_name = nil, properties = { }, relations = { }) ⇒ Draft

Returns a new instance of Draft.



10
11
12
# File 'lib/gom/object/draft.rb', line 10

def initialize(object_id = nil, class_name = nil, properties = { }, relations = { })
  @object_id, @class_name, @properties, @relations = object_id, class_name, properties, relations
end

Instance Attribute Details

#class_nameObject

Returns the value of attribute class_name.



6
7
8
# File 'lib/gom/object/draft.rb', line 6

def class_name
  @class_name
end

#object_idObject

Returns the value of attribute object_id.



5
6
7
# File 'lib/gom/object/draft.rb', line 5

def object_id
  @object_id
end

#propertiesObject



14
15
16
# File 'lib/gom/object/draft.rb', line 14

def properties
  @properties || { }
end

#relationsObject



18
19
20
# File 'lib/gom/object/draft.rb', line 18

def relations
  @relations || { }
end

Instance Method Details

#==(other) ⇒ Object



22
23
24
# File 'lib/gom/object/draft.rb', line 22

def ==(other)
  object_id == other.object_id && class_name == other.class_name && properties == other.properties && relations == other.relations
end