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.
43 44 45 46 |
# File 'lib/rpush/configuration.rb', line 43 def initialize super set_defaults end |
Instance Method Details
#log_file=(path) ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/rpush/configuration.rb', line 63 def log_file=(path) if path && !Pathname.new(path).absolute? super(File.join(Rpush.root, path)) else super end end |
#logger=(logger) ⇒ Object
71 72 73 |
# File 'lib/rpush/configuration.rb', line 71 def logger=(logger) super(logger) end |
#pid_file=(path) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/rpush/configuration.rb', line 55 def pid_file=(path) if path && !Pathname.new(path).absolute? super(File.join(Rpush.root, path)) else super end end |
#set_defaults ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/rpush/configuration.rb', line 75 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
48 49 50 51 52 53 |
# File 'lib/rpush/configuration.rb', line 48 def update(other) CONFIG_ATTRS.each do |attr| other_value = other.send(attr) send("#{attr}=", other_value) unless other_value.nil? end end |