Class: Gamefic::Scriptable::Proxy::Agent
- Inherits:
-
Object
- Object
- Gamefic::Scriptable::Proxy::Agent
- Defined in:
- lib/gamefic/scriptable/proxy.rb
Overview
The object that fetches a proxied entity.
Instance Attribute Summary collapse
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
- #fetch(container) ⇒ Object
-
#initialize(symbol) ⇒ Agent
constructor
A new instance of Agent.
Constructor Details
#initialize(symbol) ⇒ Agent
Returns a new instance of Agent.
15 16 17 |
# File 'lib/gamefic/scriptable/proxy.rb', line 15 def initialize symbol @symbol = symbol end |
Instance Attribute Details
#symbol ⇒ Object (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
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 |