Class: Draisine::Partition
- Inherits:
-
Struct
- Object
- Struct
- Draisine::Partition
- Defined in:
- lib/draisine/partitioner.rb
Instance Attribute Summary collapse
-
#deleted_ids ⇒ Object
Returns the value of attribute deleted_ids.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#model_class ⇒ Object
Returns the value of attribute model_class.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#unpersisted_ids ⇒ Object
Returns the value of attribute unpersisted_ids.
-
#updated_ids ⇒ Object
Returns the value of attribute updated_ids.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(model_class, *args) ⇒ Partition
constructor
A new instance of Partition.
Constructor Details
#initialize(model_class, *args) ⇒ Partition
Returns a new instance of Partition.
3 4 5 6 |
# File 'lib/draisine/partitioner.rb', line 3 def initialize(model_class, *args) model_class = model_class.constantize if model_class.is_a?(String) super(model_class, *args) end |
Instance Attribute Details
#deleted_ids ⇒ Object
Returns the value of attribute deleted_ids
2 3 4 |
# File 'lib/draisine/partitioner.rb', line 2 def deleted_ids @deleted_ids end |
#end_date ⇒ Object
Returns the value of attribute end_date
2 3 4 |
# File 'lib/draisine/partitioner.rb', line 2 def end_date @end_date end |
#model_class ⇒ Object
Returns the value of attribute model_class
2 3 4 |
# File 'lib/draisine/partitioner.rb', line 2 def model_class @model_class end |
#start_date ⇒ Object
Returns the value of attribute start_date
2 3 4 |
# File 'lib/draisine/partitioner.rb', line 2 def start_date @start_date end |
#unpersisted_ids ⇒ Object
Returns the value of attribute unpersisted_ids
2 3 4 |
# File 'lib/draisine/partitioner.rb', line 2 def unpersisted_ids @unpersisted_ids end |
#updated_ids ⇒ Object
Returns the value of attribute updated_ids
2 3 4 |
# File 'lib/draisine/partitioner.rb', line 2 def updated_ids @updated_ids end |
Class Method Details
.from_json(fields) ⇒ Object
13 14 15 |
# File 'lib/draisine/partitioner.rb', line 13 def self.from_json(fields) new(*fields) end |
Instance Method Details
#as_json ⇒ Object
8 9 10 11 |
# File 'lib/draisine/partitioner.rb', line 8 def as_json(*) model_class, *fields = to_a [model_class.name, *fields].as_json end |