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.



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

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.



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

def items
  @items
end

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

#sysObject (readonly)

Returns the value of attribute sys.



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

def sys
  @sys
end

Instance Method Details

#to_hObject



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

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