Class: ReciteCSV::Header::Definition::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/recite_csv/header/definition.rb

Direct Known Subclasses

Array, Hash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_definition) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/recite_csv/header/definition.rb', line 9

def initialize(raw_definition)
  @raw_definition = raw_definition
end

Instance Attribute Details

#raw_definitionObject (readonly)

Returns the value of attribute raw_definition.



7
8
9
# File 'lib/recite_csv/header/definition.rb', line 7

def raw_definition
  @raw_definition
end

Class Method Details

.newObject



21
22
23
24
25
26
27
# File 'lib/recite_csv/header/definition.rb', line 21

def self.new(*)
  if self == Base
    raise ::NotImplementedError,
          "#{self} is an abstract class and cannot be instantiated."
  end
  super
end

Instance Method Details

#build_column_methods_moduleObject



13
14
15
# File 'lib/recite_csv/header/definition.rb', line 13

def build_column_methods_module
  self.class::ColumnMethodsBuilder.new(self.raw_definition)
end

#default_csv_optionsObject



17
18
19
# File 'lib/recite_csv/header/definition.rb', line 17

def default_csv_options
  {}.freeze
end