Class: Whitebox::Batch

Inherits:
Data
  • Object
show all
Defined in:
lib/whitebox/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#completedObject (readonly)

Returns the value of attribute completed

Returns:

  • (Object)

    the current value of completed



34
35
36
# File 'lib/whitebox/models.rb', line 34

def completed
  @completed
end

#completed_atObject (readonly)

Returns the value of attribute completed_at

Returns:

  • (Object)

    the current value of completed_at



34
35
36
# File 'lib/whitebox/models.rb', line 34

def completed_at
  @completed_at
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



34
35
36
# File 'lib/whitebox/models.rb', line 34

def created_at
  @created_at
end

#failedObject (readonly)

Returns the value of attribute failed

Returns:

  • (Object)

    the current value of failed



34
35
36
# File 'lib/whitebox/models.rb', line 34

def failed
  @failed
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



34
35
36
# File 'lib/whitebox/models.rb', line 34

def id
  @id
end

#progressObject (readonly)

Returns the value of attribute progress

Returns:

  • (Object)

    the current value of progress



34
35
36
# File 'lib/whitebox/models.rb', line 34

def progress
  @progress
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



34
35
36
# File 'lib/whitebox/models.rb', line 34

def status
  @status
end

#totalObject (readonly)

Returns the value of attribute total

Returns:

  • (Object)

    the current value of total



34
35
36
# File 'lib/whitebox/models.rb', line 34

def total
  @total
end

#webhook_urlObject (readonly)

Returns the value of attribute webhook_url

Returns:

  • (Object)

    the current value of webhook_url



34
35
36
# File 'lib/whitebox/models.rb', line 34

def webhook_url
  @webhook_url
end

Class Method Details

.from_hash(h) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/whitebox/models.rb', line 35

def self.from_hash(h)
  new(
    id: h["id"],
    status: h["status"],
    total: h["total"],
    completed: h["completed"],
    failed: h["failed"],
    progress: h["progress"],
    webhook_url: h["webhook_url"],
    completed_at: h["completed_at"],
    created_at: h["created_at"]
  )
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


49
# File 'lib/whitebox/models.rb', line 49

def complete? = status == "complete"