Class: Saruman::ControllerBuilderAction

Inherits:
Object
  • Object
show all
Includes:
Virtus
Defined in:
lib/saruman.rb

Instance Method Summary collapse

Constructor Details

#initialize(action) ⇒ ControllerBuilderAction

Returns a new instance of ControllerBuilderAction.



359
360
361
362
363
364
365
366
367
368
# File 'lib/saruman.rb', line 359

def initialize(action)
  @segs = action.split(":")
  case segs.length
  when 1
    @visibility = "public"
    @respond_to = "html"
    @name = segs.first
    @method_name = "#{name}Action"
  end
end

Instance Method Details

#block_asObject



380
381
382
# File 'lib/saruman.rb', line 380

def block_as
  "#{@extension_name}#{@controller_name}#{name}"
end

#block_nameObject



376
377
378
# File 'lib/saruman.rb', line 376

def block_name
  "#{@extension_name}#{@controller_name}#{name}"
end

#block_templateObject



384
385
386
# File 'lib/saruman.rb', line 384

def block_template
  "#{@extension_name}/#{@controller_name}/#{name}.phtml"
end

#layout_handle(extension_name, controller_name) ⇒ Object



370
371
372
373
374
# File 'lib/saruman.rb', line 370

def layout_handle(extension_name, controller_name)
  @extension_name = extension_name
  @controller_name = controller_name
  "#{@extension_name}_#{@controller_name}_#{name}"
end