Method: Menu.simple_class

Defined in:
lib/xiki/menu.rb

.simple_class(*args) ⇒ Object



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/xiki/menu.rb', line 170

def self.simple_class *args
  root = 'foo'
  trunk = Xiki.trunk
  root = TextUtil.snake_case(trunk[-2][/^[\w -]+/]) if trunk.length > 1   # If nested path (due to @), grab root of parent

  %`
  - @~/menu/
    - #{root}.rb
      | class #{TextUtil.camel_case(root)}
      |   def self.menu *args
      |     "- args passed: \#{args.inspect}\n- Customize me in) @ ~/menu/#{menu}.rb"
      |   end
      | end
  `
end