tiltify 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 310eedb1d0a718fe03cb44d9f31c440f65fa7c8bb607f2a1c1e72c19f4837caf
4
- data.tar.gz: 366ae08257a081d8a0b4a6633841a97f6229d8587806cfb844f2bbe5cd2f63b2
3
+ metadata.gz: 28e06050724f28a81000611903d2ed4916137cad9ea1a1386185a2fec6bd959c
4
+ data.tar.gz: c38a443d0dd4996d0c4eee0e32965770269e09fb2963c8e113174915b27a758e
5
5
  SHA512:
6
- metadata.gz: e9764d4ef95acdf03f995dae8eeb4d869626d236b5176d25fab9affb1f879231f2a1f1ab48338537e1a927e2640d74b3faa6c86c05e6dedecf0b6bff1bf9beb2
7
- data.tar.gz: 9065cd2283a749759a757209ece3ddb494030a1142fe413942dab630bec235541b7a35c274aae98aa1551e190785e7fd8a8417949854a9cc54883627e15215dd
6
+ metadata.gz: 3bc8c628b1b082b14a35dfa1a263c7370788eeabd4601ce70462a3d8fae40bc831fdcb3ecc3d0a3181ebc778a30847c95d39d8b9447a23fbd693c55d885a5b36
7
+ data.tar.gz: 8f2d6e29205d04103e7c2b4e04098539daebde34ee1b84a6f33cb4895782a76ed053279cd7cdbb881a38164150a5776b0175995f46cceacf9fbc309f45992826
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tiltify (0.1.2)
4
+ tiltify (0.1.3)
5
5
  faraday (~> 2.0)
6
6
 
7
7
  GEM
@@ -1,19 +1,23 @@
1
1
  module Tiltify
2
2
  class Collection
3
- attr_reader :data, :total
3
+ attr_reader :data, :total, :has_prev, :has_next
4
4
 
5
5
  def self.from_response(response, type:)
6
6
  body = response.body
7
7
 
8
8
  new(
9
9
  data: body["data"].map { |attrs| type.new(attrs) },
10
- total: body["data"].count
10
+ total: body["data"].count,
11
+ has_prev: !body["links"]["prev"].blank?,
12
+ has_next: !body["links"]["next"].blank?
11
13
  )
12
14
  end
13
15
 
14
- def initialize(data:, total:)
16
+ def initialize(data:, total:, has_prev:, has_next:)
15
17
  @data = data
16
18
  @total = total
19
+ @has_prev = has_prev
20
+ @has_next = has_next
17
21
  end
18
22
  end
19
23
  end
@@ -4,8 +4,7 @@ module Tiltify
4
4
  def initialize(options = {})
5
5
  super options
6
6
 
7
- self.created_at = Time.at(options["completedAt"].to_s[0..-4].to_i)
8
- self.updated_at = Time.at(options["updatedAt"].to_s[0..-4].to_i)
7
+ self.completed_at = Time.at(options["completedAt"].to_s[0..-4].to_i)
9
8
  end
10
9
 
11
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tiltify
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiltify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
11
+ date: 2022-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday