Sha256: d2b35861516d28fb6495ac0f76d00af170aae8244f887e4491c110678e3cbf1e

Contents?: true

Size: 1.08 KB

Versions: 25

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module TailwindDsl
  module Etl
    module RawComponents
      # Source File
      #
      # SourceFile represents a list of source files that contain raw Tailwind CSS components
      class SourceFile < TailwindDsl::Etl::Element
        attr_accessor :name
        attr_accessor :file_name
        attr_accessor :file_name_only
        attr_accessor :file
        attr_accessor :target

        def initialize(**args)
          @name = grab_arg(args, :name, guard: 'Missing name')
          @file_name = grab_arg(args, :file_name, guard: 'Missing file_name')
          @file_name_only = grab_arg(args, :file_name_only, guard: 'Missing file_name_only')
          @file = grab_arg(args, :file, guard: 'Missing file')
          @target = map_to(TargetFile, grab_arg(args, :target))
        end

        def to_h
          result = {
            name: name,
            file_name: file_name,
            file_name_only: file_name_only,
            file: file
          }
          result[:target] = target.to_h if target
          result
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
tailwind_dsl-0.0.32 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.31 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.30 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.29 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.28 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.27 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.26 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.25 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.24 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.23 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.22 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.21 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.20 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.19 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.18 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.17 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.16 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.15 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.14 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb
tailwind_dsl-0.0.13 lib/tailwind_dsl/etl/raw_components/schema/source_file.rb