Class: Rpush::Configuration
- Inherits:
-
Struct
- Object
- Struct
- Rpush::Configuration
- Includes:
- Deprecatable
- Defined in:
- lib/rpush/configuration.rb
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #log_file=(path) ⇒ Object
- #logger=(logger) ⇒ Object
- #pid_file=(path) ⇒ Object
- #set_defaults ⇒ Object
- #update(other) ⇒ Object
Methods included from Deprecatable
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
41 42 43 44 |
# File 'lib/rpush/configuration.rb', line 41 def initialize super set_defaults end |
Instance Method Details
#log_file=(path) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/rpush/configuration.rb', line 61 def log_file=(path) if path && !Pathname.new(path).absolute? super(File.join(Rpush.root, path)) else super end end |
#logger=(logger) ⇒ Object
69 70 71 |
# File 'lib/rpush/configuration.rb', line 69 def logger=(logger) super(logger) end |
#pid_file=(path) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/rpush/configuration.rb', line 53 def pid_file=(path) if path && !Pathname.new(path).absolute? super(File.join(Rpush.root, path)) else super end end |
#set_defaults ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/rpush/configuration.rb', line 73 def set_defaults self.push_poll = 2 self.feedback_poll = 60 self.batch_size = 100 self.client = :active_record self.logger = nil self.log_file = 'log/rpush.log' self.pid_file = 'tmp/rpush.pid' self.log_level = (defined?(Rails) && Rails.logger) ? Rails.logger.level : ::Logger::Severity::INFO # Internal options. self. = false self.push = false end |
#update(other) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/rpush/configuration.rb', line 46 def update(other) CONFIG_ATTRS.each do |attr| other_value = other.send(attr) send("#{attr}=", other_value) unless other_value.nil? end end |