Class: Kut::Library::Rectangle

Inherits:
Object
  • Object
show all
Defined in:
lib/kut/library/components.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ccObject

Returns the value of attribute cc.



106
107
108
# File 'lib/kut/library/components.rb', line 106

def cc
  @cc
end

#convertObject

Returns the value of attribute convert.



106
107
108
# File 'lib/kut/library/components.rb', line 106

def convert
  @convert
end

#endObject

Returns the value of attribute end.



106
107
108
# File 'lib/kut/library/components.rb', line 106

def end
  @end
end

#ltraitObject

Returns the value of attribute ltrait.



106
107
108
# File 'lib/kut/library/components.rb', line 106

def ltrait
  @ltrait
end

#startObject

Returns the value of attribute start.



106
107
108
# File 'lib/kut/library/components.rb', line 106

def start
  @start
end

#unitObject

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_sObject



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