Class: Gamefic::Scriptable::Proxy::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefic/scriptable/proxy.rb

Overview

The object that fetches a proxied entity.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol) ⇒ Agent

Returns a new instance of Agent.

Parameters:

  • symbol (Symbol, Integer)


15
16
17
# File 'lib/gamefic/scriptable/proxy.rb', line 15

def initialize symbol
  @symbol = symbol
end

Instance Attribute Details

#symbolObject (readonly)

Returns the value of attribute symbol.



12
13
14
# File 'lib/gamefic/scriptable/proxy.rb', line 12

def symbol
  @symbol
end

Instance Method Details

#fetch(container) ⇒ Object

Raises:

  • (ArgumentError)


19
20
21
22
23
24
# File 'lib/gamefic/scriptable/proxy.rb', line 19

def fetch container
  result = safe_fetch(container)
  raise ArgumentError, "Unable to fetch entity from proxy agent symbol `#{symbol}`" unless result

  result
end