Class: Kut::Library::Rectangle
- Inherits:
-
Object
- Object
- Kut::Library::Rectangle
- Defined in:
- lib/kut/library/components.rb
Instance Attribute Summary collapse
-
#cc ⇒ Object
Returns the value of attribute cc.
-
#convert ⇒ Object
Returns the value of attribute convert.
-
#end ⇒ Object
Returns the value of attribute end.
-
#ltrait ⇒ Object
Returns the value of attribute ltrait.
-
#start ⇒ Object
Returns the value of attribute start.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Rectangle
constructor
:start, :end, :unit, :convert, :ltrait, :cc.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Rectangle
:start, :end, :unit, :convert, :ltrait, :cc
108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/kut/library/components.rb', line 108 def initialize(params = {}) #:start, :end, :unit, :convert, :ltrait, :cc if Hash === params @start = params[:start] ? params[:start] : [0, 0] @end = params[:end] ? params[:end] : [0, 0] @unit = params[:unit] ? params[:unit] : 0 @convert = params[:convert] ? params[:convert] : 0 @ltrait = params[:ltrait] ? params[:ltrait] : 0 @cc = params[:cc] ? params[:cc] : 'N' end #TODO implement raise exception end |
Instance Attribute Details
#cc ⇒ Object
Returns the value of attribute cc.
106 107 108 |
# File 'lib/kut/library/components.rb', line 106 def cc @cc end |
#convert ⇒ Object
Returns the value of attribute convert.
106 107 108 |
# File 'lib/kut/library/components.rb', line 106 def convert @convert end |
#end ⇒ Object
Returns the value of attribute end.
106 107 108 |
# File 'lib/kut/library/components.rb', line 106 def end @end end |
#ltrait ⇒ Object
Returns the value of attribute ltrait.
106 107 108 |
# File 'lib/kut/library/components.rb', line 106 def ltrait @ltrait end |
#start ⇒ Object
Returns the value of attribute start.
106 107 108 |
# File 'lib/kut/library/components.rb', line 106 def start @start end |
#unit ⇒ Object
Returns the value of attribute unit.
106 107 108 |
# File 'lib/kut/library/components.rb', line 106 def unit @unit end |
Instance Method Details
#to_s ⇒ Object
120 121 122 |
# File 'lib/kut/library/components.rb', line 120 def to_s "S #{@start[0]} #{@start[1]} #{@end[0]} #{@end[1]} #{@unit} #{@convert} #{@ltrait} #{@cc}\n" end |