Class: WCC::Contentful::Event::SyncComplete
- Inherits:
-
Object
- Object
- WCC::Contentful::Event::SyncComplete
- Includes:
- WCC::Contentful::Event
- Defined in:
- lib/wcc/contentful/event.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#sys ⇒ Object
readonly
Returns the value of attribute sys.
Instance Method Summary collapse
-
#initialize(items, context = nil, source: nil) ⇒ SyncComplete
constructor
A new instance of SyncComplete.
- #to_h ⇒ Object
Methods included from WCC::Contentful::Event
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
#items ⇒ Object (readonly)
Returns the value of attribute items.
151 152 153 |
# File 'lib/wcc/contentful/event.rb', line 151 def items @items end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
151 152 153 |
# File 'lib/wcc/contentful/event.rb', line 151 def source @source end |
#sys ⇒ Object (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_h ⇒ Object
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 |