Class: Dedalus::PatternLibrary::Models::LibrarySection

Inherits:
Metacosm::Model
  • Object
show all
Defined in:
lib/dedalus/pattern_library/models/library_section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#aboutObject

Returns the value of attribute about.



5
6
7
# File 'lib/dedalus/pattern_library/models/library_section.rb', line 5

def about
  @about
end

#colorObject

Returns the value of attribute color.



5
6
7
# File 'lib/dedalus/pattern_library/models/library_section.rb', line 5

def color
  @color
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/dedalus/pattern_library/models/library_section.rb', line 5

def description
  @description
end

#iconObject

Returns the value of attribute icon.



5
6
7
# File 'lib/dedalus/pattern_library/models/library_section.rb', line 5

def icon
  @icon
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/dedalus/pattern_library/models/library_section.rb', line 5

def name
  @name
end

Instance Method Details

#build_items_from_classes(klasses, kind:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dedalus/pattern_library/models/library_section.rb', line 9

def build_items_from_classes(klasses, kind:)
  klasses.each do |klass|
    item_name = klass.name.to_s

    create_library_item(
      name: item_name.demodulize.titleize,
      color: self.color,
      kind: kind,
      item_class_name: item_name,
      description: klass.description,
      example_data: klass.example_data
    )
  end
end