Class: DirectInject::Templates::Abstract

Inherits:
Object
  • Object
show all
Includes:
Tagz
Defined in:
lib/direct_inject/templates/abstract.rb

Direct Known Subclasses

Image, Javascript, Stylesheet

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, options) ⇒ Abstract

Returns a new instance of Abstract.



19
20
21
22
# File 'lib/direct_inject/templates/abstract.rb', line 19

def initialize( source , options )
  @source  = source
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/direct_inject/templates/abstract.rb', line 15

def options
  @options
end

#sourceObject (readonly)

Returns the value of attribute source.



15
16
17
# File 'lib/direct_inject/templates/abstract.rb', line 15

def source
  @source
end

Class Method Details

.render(*args, &block) ⇒ Object



11
12
13
# File 'lib/direct_inject/templates/abstract.rb', line 11

def self.render( *args , &block )
  new( *args , &block ).render
end

Instance Method Details

#tag_options(options) ⇒ Object



24
25
26
27
28
# File 'lib/direct_inject/templates/abstract.rb', line 24

def tag_options( options )
  map_options = Map.for options
  options_keys = map_options.depth_first_keys.map { | k | k.map( &:to_s ).join '-' }
  Hash[ options_keys.zip map_options.depth_first_values ]
end