Class: Embulk::Input::GoogleSpreadsheets::Typecast::Base
- Inherits:
-
Object
- Object
- Embulk::Input::GoogleSpreadsheets::Typecast::Base
show all
- Defined in:
- lib/embulk/input/google_spreadsheets/typecast/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(task) ⇒ Base
Returns a new instance of Base.
9
10
11
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 9
def initialize(task)
@null_string = task['null_string']
end
|
Instance Attribute Details
#null_string ⇒ Object
Returns the value of attribute null_string.
7
8
9
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 7
def null_string
@null_string
end
|
Instance Method Details
#as_boolean(value) ⇒ Object
39
40
41
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 39
def as_boolean(value)
raise NotImplementedError, '`embulk-input-google_spreadsheets`: override this.'
end
|
#as_double(value) ⇒ Object
35
36
37
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 35
def as_double(value)
raise NotImplementedError, '`embulk-input-google_spreadsheets`: override this.'
end
|
#as_json(value) ⇒ Object
47
48
49
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 47
def as_json(value)
raise NotImplementedError, '`embulk-input-google_spreadsheets`: override this.'
end
|
#as_long(value) ⇒ Object
31
32
33
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 31
def as_long(value)
raise NotImplementedError, '`embulk-input-google_spreadsheets`: override this.'
end
|
#as_string(value) ⇒ Object
27
28
29
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 27
def as_string(value)
raise NotImplementedError, '`embulk-input-google_spreadsheets`: override this.'
end
|
#as_timestamp(value, timestamp_format, timezone) ⇒ Object
43
44
45
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 43
def as_timestamp(value, timestamp_format, timezone)
raise NotImplementedError, '`embulk-input-google_spreadsheets`: override this.'
end
|
#logger ⇒ Object
13
14
15
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 13
def logger
GoogleSpreadsheets.logger
end
|
#to_json(*args) ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'lib/embulk/input/google_spreadsheets/typecast/base.rb', line 17
def to_json(*args) spec = {JSON.create_id => self.class.name}
spec = instance_variables.inject(spec) do |spec, v|
spec.tap do |s|
s[v] = instance_variable_get(v)
end
end
spec.to_json(*args)
end
|