Class: Aspen::Adapters::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/aspen/adapters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, ext:) ⇒ Adapter

Returns a new instance of Adapter.



7
8
9
10
11
12
13
# File 'lib/aspen/adapters.rb', line 7

def initialize(id: , name: , ext: )
  @id   = id
  @name = name
  @ext  = ext
  # @todo This will be buggy if we have a two-word class
  @renderer = Kernel.const_get("Aspen::Renderers::#{@name.downcase.capitalize}Renderer")
end

Instance Attribute Details

#extObject (readonly)

Returns the value of attribute ext.



5
6
7
# File 'lib/aspen/adapters.rb', line 5

def ext
  @ext
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/aspen/adapters.rb', line 5

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/aspen/adapters.rb', line 5

def name
  @name
end

#rendererObject (readonly)

Returns the value of attribute renderer.



5
6
7
# File 'lib/aspen/adapters.rb', line 5

def renderer
  @renderer
end