Class: OpenSandbox::Pool

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

Overview

Value object for a Pool resource

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#capacity_specObject (readonly)

Returns the value of attribute capacity_spec

Returns:

  • (Object)

    the current value of capacity_spec



100
101
102
# File 'lib/open_sandbox/models.rb', line 100

def capacity_spec
  @capacity_spec
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



100
101
102
# File 'lib/open_sandbox/models.rb', line 100

def created_at
  @created_at
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



100
101
102
# File 'lib/open_sandbox/models.rb', line 100

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



100
101
102
# File 'lib/open_sandbox/models.rb', line 100

def status
  @status
end

Class Method Details

.from_hash(h) ⇒ Object



101
102
103
104
105
106
107
108
# File 'lib/open_sandbox/models.rb', line 101

def self.from_hash(h)
  new(
    name:          h["name"],
    capacity_spec: PoolCapacitySpec.from_hash(h["capacitySpec"]),
    status:        h["status"],
    created_at:    h["createdAt"] ? Time.parse(h["createdAt"]) : nil
  )
end