Class: Osheet::WorkbookApi::StyleBuild

Inherits:
Object
  • Object
show all
Defined in:
lib/osheet/workbook_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(scope, *args, &build) ⇒ StyleBuild

Returns a new instance of StyleBuild.



47
48
49
50
# File 'lib/osheet/workbook_api.rb', line 47

def initialize(scope, *args, &build)
  @scope = scope
  @style = Osheet::Style.new(*args, &build)
end

Instance Method Details

#addObject



52
53
54
55
56
57
# File 'lib/osheet/workbook_api.rb', line 52

def add
  @scope.element_stack.current.style(@style)
  if block_given?
    @scope.element_stack.using(@style) { yield @style.build }
  end
end