Class: JSONAPI::Consumer::Implementation

Inherits:
Object
  • Object
show all
Defined in:
lib/jsonapi/consumer/implementation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Implementation

Returns a new instance of Implementation.



5
6
7
8
9
10
# File 'lib/jsonapi/consumer/implementation.rb', line 5

def initialize(data)
  # If the version member is not present, clients should assume the server implements at least version 1.0 of the specification.
  @version = data.fetch("version", "1.0")

  @meta = MetaData.new(data.fetch("meta", {}))
end

Instance Attribute Details

#metaObject (readonly)

Returns the value of attribute meta.



3
4
5
# File 'lib/jsonapi/consumer/implementation.rb', line 3

def meta
  @meta
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/jsonapi/consumer/implementation.rb', line 3

def version
  @version
end