Class: MdRecord::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/md_record/category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, name:, position:) ⇒ Category

Returns a new instance of Category.



7
8
9
10
11
# File 'lib/md_record/category.rb', line 7

def initialize(key:, name:, position:)
  @key = key
  @name = name
  @position = position
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/md_record/category.rb', line 5

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/md_record/category.rb', line 5

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



5
6
7
# File 'lib/md_record/category.rb', line 5

def position
  @position
end

Instance Method Details

#to_paramObject



13
14
15
# File 'lib/md_record/category.rb', line 13

def to_param
  key
end