class Tuya::Command::Group::GroupInit

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/tuya/cli/odm/command/group/init.rb, line 22
def initialize(argv)
        super
        @name = argv.option('name')
end
options() click to toggle source
# File lib/tuya/cli/odm/command/group/init.rb, line 16
def self.options
        [
                ['--name=group_name', '--name the name for your group']
        ]
end

Public Instance Methods

run() click to toggle source
# File lib/tuya/cli/odm/command/group/init.rb, line 9
def run
        puts "group name is #{@name}".green

        group = Tuya::ConfigGroup.new(@name)
        Tuya::TYGroup.setup_local_repo group
end
validate!() click to toggle source
# File lib/tuya/cli/odm/command/group/init.rb, line 27
def validate!
        help! "name need" unless @name
end