Class: Angular::Html2js::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/angular/html2js/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(config_name) ⇒ Object



36
37
38
39
# File 'lib/angular/html2js/configuration.rb', line 36

def method_missing(config_name, *)
  puts "Sorry, there is no such configuration option named #{config_name}"
  super
end

Instance Attribute Details

#module_nameObject

Returns the value of attribute module_name.



22
23
24
# File 'lib/angular/html2js/configuration.rb', line 22

def module_name
  @module_name
end

Instance Method Details

#cache_id(&block) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/angular/html2js/configuration.rb', line 24

def cache_id(&block)
  if block
    @cache_id = block
  else
    @cache_id
  end
end

#init_sprocketsObject



41
42
43
44
45
46
# File 'lib/angular/html2js/configuration.rb', line 41

def init_sprockets
  # hack around bug in rails assets debug mode
  # TODO: remove this once this bug is resolved: https://github.com/sstephenson/sprockets/issues/478
  Sprockets.register_engine '.haml', Angular::Html2js::Haml
  Sprockets.register_engine '.ngt', Angular::Html2js::Engine
end

#reset!Object



32
33
34
# File 'lib/angular/html2js/configuration.rb', line 32

def reset!
  @cache_id = @module_name = nil
end