Class: SimpleCombineXls

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_combine_xls.rb,
lib/simple_combine_xls/xls.rb,
lib/simple_combine_xls/config.rb,
lib/simple_combine_xls/combine.rb,
lib/simple_combine_xls/version.rb

Defined Under Namespace

Modules: Config Classes: Xls

Constant Summary collapse

VERSION =
"0.5.0"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(datas, placeholder: nil) ⇒ SimpleCombineXls

Returns a new instance of SimpleCombineXls.



4
5
6
7
8
9
# File 'lib/simple_combine_xls/combine.rb', line 4

def initialize(datas, placeholder: nil)
  validate_arguments!(datas)
  @placeholder = placeholder || Config.placeholder
  @datas       = datas
  @object_ids  = extract_object_ids
end

Instance Attribute Details

#datasObject (readonly)

Returns the value of attribute datas.



2
3
4
# File 'lib/simple_combine_xls/combine.rb', line 2

def datas
  @datas
end

#object_idsObject (readonly)

Returns the value of attribute object_ids.



2
3
4
# File 'lib/simple_combine_xls/combine.rb', line 2

def object_ids
  @object_ids
end

#placeholderObject (readonly)

Returns the value of attribute placeholder.



2
3
4
# File 'lib/simple_combine_xls/combine.rb', line 2

def placeholder
  @placeholder
end

#xlsObject

Returns the value of attribute xls.



3
4
5
# File 'lib/simple_combine_xls/combine.rb', line 3

def xls
  @xls
end

Instance Method Details

#drawing(type: "xls") ⇒ Object



11
12
13
14
15
# File 'lib/simple_combine_xls/combine.rb', line 11

def drawing(type: "xls")
  case type
  when "xls" then Xls.new(self).export
  end
end