Class: Shipeasy::Client::BoundUniverseHandle

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

Overview

Returned by Client#universe. Binds the universe name AND the client's already-resolved attributes, so assign needs no user argument.

Instance Method Summary collapse

Constructor Details

#initialize(engine, name, attributes) ⇒ BoundUniverseHandle

Returns a new instance of BoundUniverseHandle.



78
79
80
81
82
# File 'lib/shipeasy/client.rb', line 78

def initialize(engine, name, attributes)
  @engine     = engine
  @name       = name
  @attributes = attributes
end

Instance Method Details

#assignObject



84
85
86
87
88
89
# File 'lib/shipeasy/client.rb', line 84

def assign
  @engine.assign_universe(@name, @attributes)
rescue StandardError => e
  Shipeasy::Logging.error "[shipeasy] Client#universe('#{@name}').assign failed — returning not-enrolled: #{e.message}"
  Shipeasy::SDK::Eval::Assignment.new(nil, nil, {})
end