class Ruhoh::Resources::Widgets::Collection
Public Class Methods
new(ruhoh)
click to toggle source
# File lib/ruhoh/resources/widgets/collection.rb, line 5 def initialize(ruhoh) @ruhoh = ruhoh @path = File.join(@ruhoh.cascade.base, "widgets") @system_path = File.join(@ruhoh.cascade.system, "widgets") end
Public Instance Methods
url_endpoint()
click to toggle source
# File lib/ruhoh/resources/widgets/collection.rb, line 11 def url_endpoint "/assets/widgets" end
widgets()
click to toggle source
@returns registered widget names.
# File lib/ruhoh/resources/widgets/collection.rb, line 16 def widgets names = [] paths.each do |path| FileUtils.cd(path) { names += Dir["*"] } end names.uniq end