Class: TinyAdmin::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/tiny_admin/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, slug: nil, path: nil, options: {}) ⇒ Section

Returns a new instance of Section.



7
8
9
10
11
12
# File 'lib/tiny_admin/section.rb', line 7

def initialize(name:, slug: nil, path: nil, options: {})
  @name = name
  @options = options
  @path = path || TinyAdmin.route_for(slug)
  @slug = slug
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/tiny_admin/section.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/tiny_admin/section.rb', line 5

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/tiny_admin/section.rb', line 5

def path
  @path
end

#slugObject (readonly)

Returns the value of attribute slug.



5
6
7
# File 'lib/tiny_admin/section.rb', line 5

def slug
  @slug
end