Class: Cure::Dispatch

Inherits:
Object
  • Object
show all
Defined in:
lib/cure/template/dispatch.rb

Overview

This name sucks, it is just an exporter

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDispatch

Returns a new instance of Dispatch.



10
11
12
# File 'lib/cure/template/dispatch.rb', line 10

def initialize
  @named_ranges = [default]
end

Instance Attribute Details

#named_rangesObject

Parameters:

  • named_ranges (Array<Hash>)


8
9
10
# File 'lib/cure/template/dispatch.rb', line 8

def named_ranges
  @named_ranges
end

Class Method Details

.from_hash(hash) ⇒ Cure::Dispatch

Parameters:

  • hash (Array<String>)

Returns:



16
17
18
19
20
# File 'lib/cure/template/dispatch.rb', line 16

def self.from_hash(hash)
  this = Cure::Dispatch.new
  this.named_ranges = hash["sections"] if hash.key?("sections")
  this
end

Instance Method Details

#defaultObject



22
23
24
25
26
27
28
# File 'lib/cure/template/dispatch.rb', line 22

def default
  {
    "named_range" => "default",
    "file_name" => "cure-export",
    "type" => "csv"
  }
end