Class: ActsAsNewsletter::Model::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/acts_as_newsletter/model/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, &block) ⇒ Config

Returns a new instance of Config.



6
7
8
9
10
11
12
# File 'lib/acts_as_newsletter/model/config.rb', line 6

def initialize model, &block
  # Initialize config default values
  @config = { emails: [], layout: false }
  @model = model
  # Eval block to edit config
  instance_eval &block if block_given?
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/acts_as_newsletter/model/config.rb', line 4

def config
  @config
end

#modelObject (readonly)

Returns the value of attribute model.



4
5
6
# File 'lib/acts_as_newsletter/model/config.rb', line 4

def model
  @model
end