Class: Clio::Layout::Split
- Inherits:
-
Clio::Layout
- Object
- Clio::Layout
- Clio::Layout::Split
- Defined in:
- lib/clio/layout/split.rb
Overview
TODO: name LeftRight instead?
Constant Summary collapse
- PAD =
''
- FILL =
' '
- RATIO =
0.8
Instance Attribute Summary collapse
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#left ⇒ Object
Returns the value of attribute left.
-
#pad ⇒ Object
Returns the value of attribute pad.
-
#ratio ⇒ Object
Returns the value of attribute ratio.
-
#right ⇒ Object
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(left, right, options = {}) ⇒ Split
constructor
A new instance of Split.
- #print ⇒ Object
- #to_s ⇒ Object
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, ={}) @left = left @right = right @fill = FILL @ratio = RATIO @pad = PAD .each do |k,v| send("#{k}=",v) if respond_to?("#{k}=") end end |
Instance Attribute Details
#fill ⇒ Object
Returns the value of attribute fill.
19 20 21 |
# File 'lib/clio/layout/split.rb', line 19 def fill @fill end |
#left ⇒ Object
Returns the value of attribute left.
15 16 17 |
# File 'lib/clio/layout/split.rb', line 15 def left @left end |
#pad ⇒ Object
Returns the value of attribute pad.
23 24 25 |
# File 'lib/clio/layout/split.rb', line 23 def pad @pad end |
#ratio ⇒ Object
Returns the value of attribute ratio.
21 22 23 |
# File 'lib/clio/layout/split.rb', line 21 def ratio @ratio end |
#right ⇒ Object
Returns the value of attribute right.
17 18 19 |
# File 'lib/clio/layout/split.rb', line 17 def right @right end |
Instance Method Details
#print ⇒ Object
39 40 41 |
# File 'lib/clio/layout/split.rb', line 39 def print print_justified(@left, @right) end |
#to_s ⇒ Object
61 62 63 |
# File 'lib/clio/layout/split.rb', line 61 def to_s print_justified(left, right) end |