Class: Odca::ParentfulOverlay

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/odca/parentful_overlay.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent:, overlay:) ⇒ ParentfulOverlay

Returns a new instance of ParentfulOverlay.



11
12
13
14
# File 'lib/odca/parentful_overlay.rb', line 11

def initialize(parent:, overlay:)
  @parent = parent
  @overlay = overlay
end

Instance Attribute Details

#overlayObject (readonly)

Returns the value of attribute overlay.



7
8
9
# File 'lib/odca/parentful_overlay.rb', line 7

def overlay
  @overlay
end

#parentObject (readonly)

Returns the value of attribute parent.



7
8
9
# File 'lib/odca/parentful_overlay.rb', line 7

def parent
  @parent
end

Instance Method Details

#to_hObject



20
21
22
23
24
# File 'lib/odca/parentful_overlay.rb', line 20

def to_h
  { schema_base: parent_id }.merge(
    overlay.to_h
  )
end

#to_json(options = {}) ⇒ Object



16
17
18
# File 'lib/odca/parentful_overlay.rb', line 16

def to_json(options = {})
  to_h.to_json(*options)
end