Class: WCC::Contentful::Event::SyncComplete

Inherits:
Object
  • Object
show all
Includes:
WCC::Contentful::Event
Defined in:
lib/wcc/contentful/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WCC::Contentful::Event

from_raw

Constructor Details

#initialize(items, context = nil, source: nil) ⇒ SyncComplete

Returns a new instance of SyncComplete.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/wcc/contentful/event.rb', line 135

def initialize(items, context = nil, source: nil)
  @items = items.freeze
  @source = source
  @sys = WCC::Contentful::Sys.new(
    nil,
    'Array',
    nil,
    nil,
    nil,
    nil,
    nil,
    OpenStruct.new(context).freeze
  )
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



150
151
152
# File 'lib/wcc/contentful/event.rb', line 150

def items
  @items
end

#sourceObject (readonly)

Returns the value of attribute source.



150
151
152
# File 'lib/wcc/contentful/event.rb', line 150

def source
  @source
end

#sysObject (readonly)

Returns the value of attribute sys.



150
151
152
# File 'lib/wcc/contentful/event.rb', line 150

def sys
  @sys
end

Instance Method Details

#to_hObject



152
153
154
155
156
157
158
159
# File 'lib/wcc/contentful/event.rb', line 152

def to_h
  {
    'sys' => {
      'type' => 'Array'
    },
    'items' => items.map(&:to_h)
  }
end