class RocketCMS::PatchDSL

Public Class Methods

call(&blk) click to toggle source
# File lib/rocket_cms/patch.rb, line 3
def self.call(&blk)
  instance = new
  instance.instance_eval(&blk)
  instance.instance_variables.inject({}) { |result_hash, instance_variable|
    result_hash[instance_variable[1..-1].to_sym] = instance.instance_variable_get(instance_variable)
    result_hash
  }
end
new() click to toggle source
# File lib/rocket_cms/patch.rb, line 12
def initialize
  @model  = Proc.new {}
  @admin  = Proc.new {}
  @list   = Proc.new {}
  @show   = Proc.new {}
  @edit   = Proc.new {}
  @export = Proc.new {}
end

Public Instance Methods

admin(&blk) click to toggle source
# File lib/rocket_cms/patch.rb, line 22
def admin(&blk);  @admin = blk;  end
edit(&blk) click to toggle source
# File lib/rocket_cms/patch.rb, line 25
def edit(&blk);   @edit = blk;   end
export(&blk) click to toggle source
# File lib/rocket_cms/patch.rb, line 26
def export(&blk); @export = blk; end
list(&blk) click to toggle source
# File lib/rocket_cms/patch.rb, line 23
def list(&blk);   @list = blk;   end
model(&blk) click to toggle source
# File lib/rocket_cms/patch.rb, line 21
def model(&blk);  @model = blk;  end
show(&blk) click to toggle source
# File lib/rocket_cms/patch.rb, line 24
def show(&blk);   @show = blk;   end