Class: Alpr
- Inherits:
-
Object
- Object
- Alpr
- Defined in:
- lib/alpr.rb,
lib/alpr/version.rb
Constant Summary collapse
- VERSION =
'0.1.2'
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#glob ⇒ Object
readonly
Returns the value of attribute glob.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
-
#initialize(file, region = :detect, pattern = nil, max = 10, glob = false) ⇒ Alpr
constructor
A new instance of Alpr.
Constructor Details
#initialize(file, region = :detect, pattern = nil, max = 10, glob = false) ⇒ Alpr
Returns a new instance of Alpr.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/alpr.rb', line 11 def initialize(file, region=:detect, pattern=nil, max=10, glob=false) @file = file @region = region @pattern = pattern @max = max @glob = glob @output = [] begin if @glob Dir.glob(glob).each do |picture| @output.push JSON.parse(check_file(picture)) end else @output = JSON.parse(check_file(file)) end rescue JSON::ParserError @output = nil end end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
9 10 11 |
# File 'lib/alpr.rb', line 9 def command @command end |
#glob ⇒ Object (readonly)
Returns the value of attribute glob.
9 10 11 |
# File 'lib/alpr.rb', line 9 def glob @glob end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
9 10 11 |
# File 'lib/alpr.rb', line 9 def max @max end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
9 10 11 |
# File 'lib/alpr.rb', line 9 def output @output end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
9 10 11 |
# File 'lib/alpr.rb', line 9 def pattern @pattern end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
9 10 11 |
# File 'lib/alpr.rb', line 9 def region @region end |