Class: SpudBlogConfig

Inherits:
Object
  • Object
show all
Defined in:
app/models/spud_blog_config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, key:, path:, layout: nil) ⇒ SpudBlogConfig

Returns a new instance of SpudBlogConfig.



19
20
21
22
23
24
# File 'app/models/spud_blog_config.rb', line 19

def initialize(name:, key:, path:, layout: nil)
  @name = name
  @key = key
  @path = path
  @layout = layout || Spud::Blog.config.base_layout
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



17
18
19
# File 'app/models/spud_blog_config.rb', line 17

def key
  @key
end

#layoutObject

Returns the value of attribute layout.



17
18
19
# File 'app/models/spud_blog_config.rb', line 17

def layout
  @layout
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'app/models/spud_blog_config.rb', line 17

def name
  @name
end

#pathObject

Returns the value of attribute path.



17
18
19
# File 'app/models/spud_blog_config.rb', line 17

def path
  @path
end

Class Method Details

.eachObject



11
12
13
14
15
# File 'app/models/spud_blog_config.rb', line 11

def self.each
  Spud::Blog.config.blogs.each do |config|
    yield(config)
  end
end

.find(key) ⇒ Object



7
8
9
# File 'app/models/spud_blog_config.rb', line 7

def self.find(key)
  return Spud::Blog.config.blogs.find { |it| it.key == key }
end

.push(config) ⇒ Object



3
4
5
# File 'app/models/spud_blog_config.rb', line 3

def self.push(config)
  Spud::Blog.config.blogs.push(new(config))
end