Class: Ember::ES6Template::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ember/es6_template/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#module_prefixObject

Returns the value of attribute module_prefix.



4
5
6
# File 'lib/ember/es6_template/config.rb', line 4

def module_prefix
  @module_prefix
end

#prefix_dirsObject

Returns the value of attribute prefix_dirs.



5
6
7
# File 'lib/ember/es6_template/config.rb', line 5

def prefix_dirs
  @prefix_dirs
end

#prefix_filesObject

Returns the value of attribute prefix_files.



5
6
7
# File 'lib/ember/es6_template/config.rb', line 5

def prefix_files
  @prefix_files
end

Instance Method Details

#prefix_patternObject



19
20
21
22
23
24
25
26
27
# File 'lib/ember/es6_template/config.rb', line 19

def prefix_pattern
  @prefix_pattern ||= begin
    patterns = []
    patterns += Array(prefix_dirs).map {|dir| Regexp.new("^#{dir}/") }
    patterns += Array(prefix_files).map {|file| Regexp.new("^#{file}$") }

    patterns.empty? ? // : Regexp.union(patterns)
  end
end

#to_hashObject



29
30
31
32
33
34
35
# File 'lib/ember/es6_template/config.rb', line 29

def to_hash
  {
    module_prefix: module_prefix,
    prefix_files: prefix_files,
    prefix_dirs: prefix_dirs
  }
end