Class: JsonUpdater::OneLevelJsonArrayBuilder
- Inherits:
-
Object
- Object
- JsonUpdater::OneLevelJsonArrayBuilder
- Defined in:
- lib/json_updater/one_level_json_array_builder.rb
Instance Attribute Summary collapse
-
#json_changeable ⇒ Object
readonly
Returns the value of attribute json_changeable.
-
#json_etalon ⇒ Object
readonly
Returns the value of attribute json_etalon.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(json_changeable:, json_etalon:) ⇒ OneLevelJsonArrayBuilder
constructor
A new instance of OneLevelJsonArrayBuilder.
Constructor Details
#initialize(json_changeable:, json_etalon:) ⇒ OneLevelJsonArrayBuilder
Returns a new instance of OneLevelJsonArrayBuilder.
11 12 13 14 |
# File 'lib/json_updater/one_level_json_array_builder.rb', line 11 def initialize(json_changeable:, json_etalon:) @json_changeable = json_changeable @json_etalon = json_etalon end |
Instance Attribute Details
#json_changeable ⇒ Object (readonly)
Returns the value of attribute json_changeable.
5 6 7 |
# File 'lib/json_updater/one_level_json_array_builder.rb', line 5 def json_changeable @json_changeable end |
#json_etalon ⇒ Object (readonly)
Returns the value of attribute json_etalon.
5 6 7 |
# File 'lib/json_updater/one_level_json_array_builder.rb', line 5 def json_etalon @json_etalon end |
Class Method Details
.build(json_changeable:, json_etalon:) ⇒ Object
7 8 9 |
# File 'lib/json_updater/one_level_json_array_builder.rb', line 7 def self.build(json_changeable:, json_etalon:) new(json_changeable: json_changeable, json_etalon: json_etalon).build end |
Instance Method Details
#build ⇒ Object
16 17 18 19 20 |
# File 'lib/json_updater/one_level_json_array_builder.rb', line 16 def build json_changeable.map do |json_item| JsonStructureUpdater.update_json(json_changeable: json_item, json_etalon: json_etalon) end end |