Class: Boletoman::Builders::Base
- Inherits:
-
Object
- Object
- Boletoman::Builders::Base
- Defined in:
- lib/boletoman/builders/base.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#duplicate? ⇒ Boolean
segunda via.
- #formatter ⇒ Object
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
- #instance ⇒ Object
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/boletoman/builders/base.rb', line 9 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/boletoman/builders/base.rb', line 7 def data @data end |
Class Method Details
.generator ⇒ Object
21 22 23 |
# File 'lib/boletoman/builders/base.rb', line 21 def self.generator to_s.demodulize.downcase end |
Instance Method Details
#build ⇒ Object
13 14 15 |
# File 'lib/boletoman/builders/base.rb', line 13 def build ::Boletoman::Boleto.new(instance) end |
#duplicate? ⇒ Boolean
segunda via
30 31 32 |
# File 'lib/boletoman/builders/base.rb', line 30 def duplicate? data.dig(:boleto, :duplicate) == true end |
#formatter ⇒ Object
25 26 27 |
# File 'lib/boletoman/builders/base.rb', line 25 def formatter @formatter ||= Formatter.new(data) end |
#instance ⇒ Object
17 18 19 |
# File 'lib/boletoman/builders/base.rb', line 17 def instance raise NotImplementedError end |