Class: Base
- Inherits:
-
Object
show all
- Defined in:
- lib/parser/base.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(doc) ⇒ Base
Returns a new instance of Base.
2
3
4
5
|
# File 'lib/parser/base.rb', line 2
def initialize(doc)
@doc = doc
@sheet = doc.sheet(self.class.get_sheet_name)
end
|
Class Method Details
.get_sheet_name ⇒ Object
25
26
27
|
# File 'lib/parser/base.rb', line 25
def self.get_sheet_name
@sheet_name
end
|
.sheet_name(sheet_name) ⇒ Object
20
21
22
23
|
# File 'lib/parser/base.rb', line 20
def self.sheet_name(sheet_name)
raise "Please define the sheet name" unless sheet_name
@sheet_name = sheet_name
end
|
Instance Method Details
#parse_sheet ⇒ Object
12
13
14
|
# File 'lib/parser/base.rb', line 12
def parse_sheet
raise 'please define parse_sheet method'
end
|
#reload_sheet(sheet_name) ⇒ Object
16
17
18
|
# File 'lib/parser/base.rb', line 16
def reload_sheet(sheet_name)
@sheet = @doc.sheet(sheet_name)
end
|
#to_json ⇒ Object
7
8
9
10
|
# File 'lib/parser/base.rb', line 7
def to_json
return unless @sheet
parse_sheet
end
|