Class: MiniEtl::Source
- Inherits:
-
Object
- Object
- MiniEtl::Source
- Includes:
- Status
- Defined in:
- lib/mini_etl/source.rb
Overview
Source data from a give type and location
Constant Summary collapse
- VALID_STATES =
{ initialized: 0, validated: 1, sourced: 2, failed: 3 }.freeze
- ACCEPTED_PARAMS =
%i[type location data].freeze
Constants included from Status
MiniEtl::Status::DEFAULT_STATES
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#location ⇒ Object
Returns the value of attribute location.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(params = {}) ⇒ Source
constructor
A new instance of Source.
- #validate ⇒ Object
Methods included from Status
Constructor Details
#initialize(params = {}) ⇒ Source
Returns a new instance of Source.
19 20 21 22 23 24 25 |
# File 'lib/mini_etl/source.rb', line 19 def initialize(params = {}) ACCEPTED_PARAMS.each do |param| instance_variable_set "@#{param}".to_sym, params[param] end @payload = [] initialized! end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
15 16 17 |
# File 'lib/mini_etl/source.rb', line 15 def data @data end |
#location ⇒ Object
Returns the value of attribute location.
15 16 17 |
# File 'lib/mini_etl/source.rb', line 15 def location @location end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
16 17 18 |
# File 'lib/mini_etl/source.rb', line 16 def payload @payload end |
#type ⇒ Object
Returns the value of attribute type.
15 16 17 |
# File 'lib/mini_etl/source.rb', line 15 def type @type end |