Class: Resourceful::Agent::Base
- Inherits:
-
Object
- Object
- Resourceful::Agent::Base
- Defined in:
- lib/resourceful/agent/base.rb
Direct Known Subclasses
Constant Summary collapse
- ATTRS =
[:host, :user, :password, :expiration, :log_prefix]
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#expiration ⇒ Object
readonly
Returns the value of attribute expiration.
-
#log_prefix ⇒ Object
readonly
Returns the value of attribute log_prefix.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(args = {}) ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 |
# File 'lib/resourceful/agent/base.rb', line 14 def initialize(args={}) ATTRS.each { |a| instance_variable_set("@#{a.to_s}", args.delete(a)) } @cache = Resourceful::Resource::Cache.new @expiration @logger = Log4r::Logger.new('[Resourceful]') @logger.add(Log4r::StdoutOutputter.new('console')) end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
9 10 11 |
# File 'lib/resourceful/agent/base.rb', line 9 def cache @cache end |
#expiration ⇒ Object (readonly)
Returns the value of attribute expiration.
9 10 11 |
# File 'lib/resourceful/agent/base.rb', line 9 def expiration @expiration end |
#log_prefix ⇒ Object (readonly)
Returns the value of attribute log_prefix.
9 10 11 |
# File 'lib/resourceful/agent/base.rb', line 9 def log_prefix @log_prefix end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/resourceful/agent/base.rb', line 9 def logger @logger end |