Class: Croatia::QRCode
- Inherits:
-
Object
- Object
- Croatia::QRCode
- Defined in:
- lib/croatia/qr_code.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data, **options) ⇒ QRCode
constructor
A new instance of QRCode.
- #to_png(**options) ⇒ Object
- #to_svg(**options) ⇒ Object
Constructor Details
#initialize(data, **options) ⇒ QRCode
Returns a new instance of QRCode.
16 17 18 19 |
# File 'lib/croatia/qr_code.rb', line 16 def initialize(data, **) @data = data @options = end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
14 15 16 |
# File 'lib/croatia/qr_code.rb', line 14 def data @data end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/croatia/qr_code.rb', line 14 def @options end |
Class Method Details
.ensure_supported! ⇒ Object
4 5 6 7 8 |
# File 'lib/croatia/qr_code.rb', line 4 def self.ensure_supported! return if supported? raise LoadError, "RQRCode library is not loaded. Please ensure you have the rqrcode gem installed and required." end |
.supported? ⇒ Boolean
10 11 12 |
# File 'lib/croatia/qr_code.rb', line 10 def self.supported? defined?(RQRCode) end |
Instance Method Details
#to_png(**options) ⇒ Object
25 26 27 |
# File 'lib/croatia/qr_code.rb', line 25 def to_png(**) qr_code.as_png(**) end |
#to_svg(**options) ⇒ Object
21 22 23 |
# File 'lib/croatia/qr_code.rb', line 21 def to_svg(**) qr_code.as_svg(**) end |