Class: ShopifyTransporter::RecordBuilder
- Inherits:
-
Object
- Object
- ShopifyTransporter::RecordBuilder
- Defined in:
- lib/shopify_transporter/record_builder/record_builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#instances ⇒ Object
Returns the value of attribute instances.
Instance Method Summary collapse
- #build(input) {|record_from(input)| ... } ⇒ Object
-
#initialize(key_name, key_required) ⇒ RecordBuilder
constructor
A new instance of RecordBuilder.
Constructor Details
#initialize(key_name, key_required) ⇒ RecordBuilder
Returns a new instance of RecordBuilder.
17 18 19 20 21 |
# File 'lib/shopify_transporter/record_builder/record_builder.rb', line 17 def initialize(key_name, key_required) @instances = {} @key_name = key_name @key_required = key_required end |
Instance Attribute Details
#instances ⇒ Object
Returns the value of attribute instances.
15 16 17 |
# File 'lib/shopify_transporter/record_builder/record_builder.rb', line 15 def instances @instances end |
Instance Method Details
#build(input) {|record_from(input)| ... } ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/shopify_transporter/record_builder/record_builder.rb', line 23 def build(input) (input) if key_of(input).nil? yield @last_record return end yield record_from(input) end |