class ProjectGenerator::Command::ProcessFiles::RenderVariables

Class for a single object which should be a scope in render

Attributes

indentation[R]
name[R]

Public Class Methods

new(name, indentation) click to toggle source
# File lib/project_generator/command/process_files/render_variables.rb, line 20
def initialize(name, indentation)
        @name = name
        @indentation = indentation
end

Public Instance Methods

get_binding() click to toggle source
`public :binding` and `send :binding` return caller binding
This is from ERB documentation: https://ruby-doc.org/core-2.7.2/Binding.html

rubocop:disable Naming/AccessorMethodName

# File lib/project_generator/command/process_files/render_variables.rb, line 28
def get_binding
        binding
end
module_name() click to toggle source
# File lib/project_generator/command/process_files/render_variables.rb, line 41
        def module_name
        path.camelize
end
modules() click to toggle source
# File lib/project_generator/command/process_files/render_variables.rb, line 45
        def modules
        module_name.split('::')
end
path() click to toggle source
# File lib/project_generator/command/process_files/render_variables.rb, line 33
        def path
        name.tr('-', '/')
end
title() click to toggle source
# File lib/project_generator/command/process_files/render_variables.rb, line 37
        def title
        name.split(/[-_]/).map(&:camelize).join(' ')
end