Class: LetItFall::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/let_it_fall/cli.rb

Instance Method Summary collapse

Instance Method Details

#code(*code) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/let_it_fall/cli.rb', line 35

def code(*code)
  if options[:range]
    st, ed = code.minmax
    code = Range.new(st.to_i(16), ed.to_i(16))
                .to_a.map { |i| i.to_s(16) }
  end
  run(code, options[:speed], options[:color], options[:matrix])
end

#matrix(mark = :latin) ⇒ Object



26
27
28
# File 'lib/let_it_fall/cli.rb', line 26

def matrix(mark=:latin)
  run(mark, options[:speed], options[:color], true)
end

#randObject



18
19
20
21
# File 'lib/let_it_fall/cli.rb', line 18

def rand
  code = LetItFall::CODESET.keys.sample
  run(code, options[:speed], options[:color], false)
end

#versionObject



45
46
47
# File 'lib/let_it_fall/cli.rb', line 45

def version
  puts "LetItFall #{LetItFall::VERSION} (c) 2014 kyoendo"
end