Class: Keybase::Dump

Inherits:
Object
  • Object
show all
Defined in:
lib/keybase/models/dump.rb

Overview

A dump object containing hashes, IDs and data links from which a mirror can be configured.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Dump

Returns a new instance of Dump.



9
10
11
12
13
14
15
16
17
# File 'lib/keybase/models/dump.rb', line 9

def initialize(params)
  @id = params['dump_id']
  @full_data = params['full_data']
  @full_data_sha256 = params['full_data_sha256']
  @parent_dump_id = params['parent_dump_id']
  @changes_from_parent = params['changes_from_parent']
  @changes_sha256 = params['changes_sha256']
  @created_at = Time.at(params['ctime']).to_datetime
end

Instance Attribute Details

#changes_from_parentObject (readonly)

Returns the value of attribute changes_from_parent.



6
7
8
# File 'lib/keybase/models/dump.rb', line 6

def changes_from_parent
  @changes_from_parent
end

#changes_sha256Object (readonly)

Returns the value of attribute changes_sha256.



6
7
8
# File 'lib/keybase/models/dump.rb', line 6

def changes_sha256
  @changes_sha256
end

#created_atObject (readonly)

Returns the value of attribute created_at.



6
7
8
# File 'lib/keybase/models/dump.rb', line 6

def created_at
  @created_at
end

#full_dataObject (readonly)

Returns the value of attribute full_data.



6
7
8
# File 'lib/keybase/models/dump.rb', line 6

def full_data
  @full_data
end

#full_data_sha256Object (readonly)

Returns the value of attribute full_data_sha256.



6
7
8
# File 'lib/keybase/models/dump.rb', line 6

def full_data_sha256
  @full_data_sha256
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/keybase/models/dump.rb', line 6

def id
  @id
end

#parent_dump_idObject (readonly)

Returns the value of attribute parent_dump_id.



6
7
8
# File 'lib/keybase/models/dump.rb', line 6

def parent_dump_id
  @parent_dump_id
end

Class Method Details

.all[Keybase::Dump]

Retrieve the dump history from Keybase

Returns:



22
23
24
# File 'lib/keybase/models/dump.rb', line 22

def self.all
  Request::Dump.all.map{|dump| new(dump)}
end

.latestKeybase::Dump

Retrieve the latest dump from Keybase

Returns:



29
30
31
# File 'lib/keybase/models/dump.rb', line 29

def self.latest
  new(Request::Dump.latest)
end