lib/admin_it/shared.rb in admin_it-1.1.0 vs lib/admin_it/shared.rb in admin_it-1.2.0
- old
+ new
@@ -4,10 +4,14 @@
module Renderable
extend ExtendIt::DslModule
dsl { dsl_block :render }
+ def renderable?
+ !@render.nil?
+ end
+
def render(entity, instance = nil, &block)
return if @render.nil?
# method used as event emmiter, call block in instance or caller
# context if it present
if instance.nil?
@@ -29,9 +33,13 @@
@icon = value.nil? ? default_icon : value.to_s
end
def icon
@icon ||= default_icon
+ end
+
+ def icon?
+ !@icon.nil? && !icon.empty?
end
protected
def default_icon