Class: Fathom::Agent
Instance Method Summary collapse
- #callbacks ⇒ Object
-
#initialize(opts = {}) ⇒ Agent
constructor
A new instance of Agent.
- #states ⇒ Object
Methods included from Properties
Constructor Details
#initialize(opts = {}) ⇒ Agent
Returns a new instance of Agent.
10 11 12 13 |
# File 'lib/fathom/agent.rb', line 10 def initialize(opts={}) self.class.define_property_states assert_node_accessors(opts) end |
Instance Method Details
#callbacks ⇒ Object
22 23 24 |
# File 'lib/fathom/agent.rb', line 22 def callbacks @callbacks ||= (self.methods - Object.methods).grep(/^on_(\w+)/) end |
#states ⇒ Object
15 16 17 18 19 20 |
# File 'lib/fathom/agent.rb', line 15 def states @states ||= self.class.properties.inject({}) do |h, state_method_name| h[state_method_name] = nil h end end |