Class: ZBar::Symbol
- Inherits:
-
Object
- Object
- ZBar::Symbol
- Defined in:
- lib/zbar/symbol.rb
Instance Attribute Summary collapse
-
#addon ⇒ Object
readonly
Returns the value of attribute addon.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#quality ⇒ Object
readonly
Returns the value of attribute quality.
-
#symbology ⇒ Object
readonly
Returns the value of attribute symbology.
Instance Method Summary collapse
- #==(symbol) ⇒ Object
-
#initialize(symbol = nil) ⇒ Symbol
constructor
A new instance of Symbol.
Constructor Details
#initialize(symbol = nil) ⇒ Symbol
Returns a new instance of Symbol.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zbar/symbol.rb', line 6 def initialize(symbol=nil) if symbol type = ZBar.(symbol) @symbology = ZBar.(type) @data = ZBar.(symbol) @addon = ZBar.(type) @quality = ZBar.(symbol) @location = [] point_count = ZBar.(symbol) i = 0 while i < point_count @location << [ZBar.(symbol, i), ZBar.(symbol, i)] i += 1 end end end |
Instance Attribute Details
#addon ⇒ Object (readonly)
Returns the value of attribute addon.
4 5 6 |
# File 'lib/zbar/symbol.rb', line 4 def addon @addon end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/zbar/symbol.rb', line 4 def data @data end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
4 5 6 |
# File 'lib/zbar/symbol.rb', line 4 def location @location end |
#quality ⇒ Object (readonly)
Returns the value of attribute quality.
4 5 6 |
# File 'lib/zbar/symbol.rb', line 4 def quality @quality end |
#symbology ⇒ Object (readonly)
Returns the value of attribute symbology.
4 5 6 |
# File 'lib/zbar/symbol.rb', line 4 def symbology @symbology end |
Instance Method Details
#==(symbol) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/zbar/symbol.rb', line 24 def ==(symbol) return false unless symbol.kind_of?(Symbol) ( self.symbology == symbol.symbology && self.data == symbol.data && self.addon == symbol.addon && self.quality == symbol.quality && self.location == symbol.location ) end |