Class: RQRCode::Renderer::Body
- Inherits:
-
Object
- Object
- RQRCode::Renderer::Body
- Defined in:
- lib/rqrcode/renderer.rb
Instance Attribute Summary collapse
-
#modules ⇒ Object
Returns the value of attribute modules.
-
#options ⇒ Object
Returns the value of attribute options.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #height ⇒ Object
-
#initialize(modules, type, options = {}) ⇒ Body
constructor
A new instance of Body.
- #scale ⇒ Object
- #width ⇒ Object
Constructor Details
#initialize(modules, type, options = {}) ⇒ Body
Returns a new instance of Body.
46 47 48 49 50 |
# File 'lib/rqrcode/renderer.rb', line 46 def initialize modules, type, ={} self.modules = modules self.type = type self. = end |
Instance Attribute Details
#modules ⇒ Object
Returns the value of attribute modules.
35 36 37 |
# File 'lib/rqrcode/renderer.rb', line 35 def modules @modules end |
#options ⇒ Object
Returns the value of attribute options.
35 36 37 |
# File 'lib/rqrcode/renderer.rb', line 35 def @options end |
#type ⇒ Object
Returns the value of attribute type.
35 36 37 |
# File 'lib/rqrcode/renderer.rb', line 35 def type @type end |
Class Method Details
Instance Method Details
#height ⇒ Object
56 57 58 |
# File 'lib/rqrcode/renderer.rb', line 56 def height modules.length end |
#scale ⇒ Object
60 61 62 |
# File 'lib/rqrcode/renderer.rb', line 60 def scale @scale ||= [[:scale].to_i, 1].max end |
#width ⇒ Object
52 53 54 |
# File 'lib/rqrcode/renderer.rb', line 52 def width modules.first.length end |