Module: CCheck
- Defined in:
- lib/ccheck.rb,
lib/ccheck/cli.rb,
lib/ccheck/card.rb,
lib/ccheck/luhn.rb,
lib/ccheck/version.rb
Defined Under Namespace
Constant Summary collapse
- Version =
'0.1.0'
Class Method Summary collapse
-
.print(input) ⇒ Object
Public: Prints to stdout CC info.
-
.type(number) ⇒ Object
Public: Determines CC type.
-
.valid?(number) ⇒ Boolean
Public: Verifies if number is a valid CC number according to Luhn algorithm.
Class Method Details
.print(input) ⇒ Object
Public: Prints to stdout CC info.
Input - String or Array
If parameter is a String, prints CC info. if parameter is an Array, print their info one by one.
35 36 37 38 39 40 41 |
# File 'lib/ccheck.rb', line 35 def print input if input.is_a? Array input.each { |number| puts Card.new(number).to_s } else puts Card.new(input).to_s end end |