Class: Clio::Layout::Split

Inherits:
Clio::Layout show all
Defined in:
lib/clio/layout/split.rb

Overview

TODO: name LeftRight instead?

Constant Summary collapse

PAD =
''
FILL =
' '
RATIO =
0.8

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(left, right, options = {}) ⇒ Split

Returns a new instance of Split.



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/clio/layout/split.rb', line 26

def initialize(left, right, options={})
  @left    = left
  @right   = right

  @fill    = FILL
  @ratio   = RATIO
  @pad     = PAD

  options.each do |k,v|
    send("#{k}=",v) if respond_to?("#{k}=")
  end
end

Instance Attribute Details

#fillObject

Returns the value of attribute fill.



19
20
21
# File 'lib/clio/layout/split.rb', line 19

def fill
  @fill
end

#leftObject

Returns the value of attribute left.



15
16
17
# File 'lib/clio/layout/split.rb', line 15

def left
  @left
end

#padObject

Returns the value of attribute pad.



23
24
25
# File 'lib/clio/layout/split.rb', line 23

def pad
  @pad
end

#ratioObject

Returns the value of attribute ratio.



21
22
23
# File 'lib/clio/layout/split.rb', line 21

def ratio
  @ratio
end

#rightObject

Returns the value of attribute right.



17
18
19
# File 'lib/clio/layout/split.rb', line 17

def right
  @right
end

Instance Method Details



39
40
41
# File 'lib/clio/layout/split.rb', line 39

def print
  print_justified(@left, @right)
end

#to_sObject



61
62
63
# File 'lib/clio/layout/split.rb', line 61

def to_s
  print_justified(left, right)
end