Class: SilkLayout::Layout::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/silk_layout/layout/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width:, page_size: nil) ⇒ Context

Returns a new instance of Context.



8
9
10
11
# File 'lib/silk_layout/layout/context.rb', line 8

def initialize(width:, page_size: nil)
  @width = width
  @page_size = page_size
end

Instance Attribute Details

#page_sizeObject (readonly)

Returns the value of attribute page_size.



6
7
8
# File 'lib/silk_layout/layout/context.rb', line 6

def page_size
  @page_size
end

#widthObject (readonly)

Returns the value of attribute width.



6
7
8
# File 'lib/silk_layout/layout/context.rb', line 6

def width
  @width
end

Instance Method Details

#viewport_widthObject



13
14
15
# File 'lib/silk_layout/layout/context.rb', line 13

def viewport_width
  width
end