Module: Subjoin::Metable

Included in:
Document, Identifier, JsonApi, Link, Relationship, Resource
Defined in:
lib/subjoin/metable.rb

Overview

Generically handle meta objects

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metaMeta (readonly)

The object’s meta attribute

Returns:



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

def meta
  @meta
end

Instance Method Details

#has_meta?Boolean

Returns:



17
18
19
# File 'lib/subjoin/metable.rb', line 17

def has_meta?
  return ! @meta.nil?
end

#load_meta(data) ⇒ Metable?

Load the object’s attributes

Parameters:

  • The object’s parsed JSON meta member

Returns:



12
13
14
15
# File 'lib/subjoin/metable.rb', line 12

def load_meta(data)
  return nil if data.nil?
  Meta.new(data)
end