Class: Statsig::IDList

Inherits:
Object
  • Object
show all
Defined in:
lib/id_list.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json, ids = Set.new) ⇒ IDList

Returns a new instance of IDList.



11
12
13
14
15
16
17
18
19
# File 'lib/id_list.rb', line 11

def initialize(json, ids = Set.new)
  @name = json['name'] || ''
  @size = json['size'] || 0
  @creation_time = json['creationTime'] || 0
  @url = json['url']
  @file_id = json['fileID']

  @ids = ids
end

Instance Attribute Details

#creation_timeObject

Returns the value of attribute creation_time.



6
7
8
# File 'lib/id_list.rb', line 6

def creation_time
  @creation_time
end

#file_idObject

Returns the value of attribute file_id.



8
9
10
# File 'lib/id_list.rb', line 8

def file_id
  @file_id
end

#idsObject

Returns the value of attribute ids.



9
10
11
# File 'lib/id_list.rb', line 9

def ids
  @ids
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/id_list.rb', line 4

def name
  @name
end

#sizeObject

Returns the value of attribute size.



5
6
7
# File 'lib/id_list.rb', line 5

def size
  @size
end

#urlObject

Returns the value of attribute url.



7
8
9
# File 'lib/id_list.rb', line 7

def url
  @url
end

Class Method Details

.new_empty(json) ⇒ Object



21
22
23
24
# File 'lib/id_list.rb', line 21

def self.new_empty(json)
  new(json)
  @size = 0
end

Instance Method Details

#==(other) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/id_list.rb', line 26

def ==(other)
  return false if other.nil?

  self.name == other.name &&
    self.size == other.size &&
    self.creation_time == other.creation_time &&
    self.url == other.url &&
    self.file_id == other.file_id &&
    self.ids == other.ids
end