Class: SimpleJsonApi::Resource

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/simple_json_api/resource.rb

Overview

The representation of a Resource

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Resource

Returns a new instance of Resource.



7
8
9
# File 'lib/simple_json_api/resource.rb', line 7

def initialize(content)
  @content = content
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
14
15
16
# File 'lib/simple_json_api/resource.rb', line 11

def ==(other)
  (@content[:type] &&
    (@content[:type] == other[:type])) &&
    (@content[:id] &&
      (@content[:id] == other[:id]))
end