Sha256: 286666951fa0d63bab69a121a74062324274c422c004ac3b25ae9194de613e77

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

class CategoryDirector < KDirector::Directors::BaseDirector
  def category(name, description)
    value = {
      name: name,
      description: description
    }

    builder.add(:categories, value: value)

    self
  end

  def category_file
    k_builder.target_folders.join(:builder_data, 'categories.json')
  end

  def save_categories
    cd(:builder_data)
    add('categories.json', content: builder.to_json)

    self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cmdlet-0.0.7 .builders/director/category_director.rb