File tree Expand file tree Collapse file tree 6 files changed +45
-3
lines changed
Expand file tree Collapse file tree 6 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 77\. yardoc
88.DS_Store
99.bundle /
10- * /rspec_results.html
10+ * /rspec_results.html
11+ vendor /
Original file line number Diff line number Diff line change 11## CHANGELOG
22------------------------------------------------
33
4+ ## Version 0.3.0
5+ ### Date: 17th-Mar-2021
6+ ### New Features
7+ - Sync API module support added
8+
9+ ------------------------------------------------
410## Version 0.2.0
511
612 ### New Features
Original file line number Diff line number Diff line change 11The MIT License (MIT)
22
3- Copyright (c) 2012-2019 Contentstack. All Rights Reserved
3+ Copyright (c) 2012-2021 Contentstack. All Rights Reserved
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ def self.get_assets(asset_uid=nil)
4040 send_request ( path )
4141 end
4242
43+ def self . get_sync_items ( query )
44+ path = "/stacks/sync"
45+ send_request ( path , query )
46+ end
47+
4348 private
4449 def self . send_request ( path , q = nil )
4550 q ||= { }
Original file line number Diff line number Diff line change 1+ require 'active_support/core_ext'
2+
3+ module Contentstack
4+ class SyncResult
5+ attr_reader :items
6+ attr_reader :sync_token
7+ attr_reader :pagination_token
8+ attr_reader :total_count
9+ attr_reader :skip
10+ attr_reader :limit
11+
12+ def initialize ( sync_result )
13+ if sync_result . nil?
14+ @items = [ ]
15+ @sync_token = nil
16+ @pagination_token = nil
17+ @total_count = 0
18+ @skip = 0
19+ @limit = 100
20+ else
21+ @items = sync_result [ "items" ] || [ ]
22+ @sync_token = sync_result [ "sync_token" ] || nil
23+ @pagination_token = sync_result [ "pagination_token" ] || nil
24+ @total_count = sync_result [ "total_count" ] || 0
25+ @skip = sync_result [ "skip" ] || 0
26+ @limit = sync_result [ "limit" ] || 100
27+ end
28+ end
29+ end
30+ end
Original file line number Diff line number Diff line change 11module Contentstack
2- VERSION = "0.2 .0"
2+ VERSION = "0.3 .0"
33end
You can’t perform that action at this time.
0 commit comments