Class: Kut::Library::Text
- Inherits:
-
Object
- Object
- Kut::Library::Text
- Defined in:
- lib/kut/library/components.rb
Instance Attribute Summary collapse
-
#convert ⇒ Object
Returns the value of attribute convert.
-
#dimension ⇒ Object
Returns the value of attribute dimension.
-
#orientation ⇒ Object
Returns the value of attribute orientation.
-
#pos ⇒ Object
Returns the value of attribute pos.
-
#text ⇒ Object
Returns the value of attribute text.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Text
constructor
:orientation, :pos, :dimension, :unit, :convert, :text.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Text
:orientation, :pos, :dimension, :unit, :convert, :text
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/kut/library/components.rb', line 64 def initialize(params = {}) #:orientation, :pos, :dimension, :unit, :convert, :text if Hash === params @orientation = params[:orientation] ? params[:orientation] : 0 @pos = params[:pos] ? params[:pos] : [0, 0] @dimension = params[:dimension] ? params[:dimension] : 40 @unit = params[:unit] ? params[:unit] : 0 @convert = params[:convert] ? params[:convert] : 0 @text = params[:text] ? params[:text] : '' end #TODO implement raise exception end |
Instance Attribute Details
#convert ⇒ Object
Returns the value of attribute convert.
61 62 63 |
# File 'lib/kut/library/components.rb', line 61 def convert @convert end |
#dimension ⇒ Object
Returns the value of attribute dimension.
61 62 63 |
# File 'lib/kut/library/components.rb', line 61 def dimension @dimension end |
#orientation ⇒ Object
Returns the value of attribute orientation.
61 62 63 |
# File 'lib/kut/library/components.rb', line 61 def orientation @orientation end |
#pos ⇒ Object
Returns the value of attribute pos.
61 62 63 |
# File 'lib/kut/library/components.rb', line 61 def pos @pos end |
#text ⇒ Object
Returns the value of attribute text.
61 62 63 |
# File 'lib/kut/library/components.rb', line 61 def text @text end |
#unit ⇒ Object
Returns the value of attribute unit.
61 62 63 |
# File 'lib/kut/library/components.rb', line 61 def unit @unit end |
Instance Method Details
#to_s ⇒ Object
76 77 78 |
# File 'lib/kut/library/components.rb', line 76 def to_s "T #{@orientation} #{@pos[0]} #{@pos[1]} #{@dimension} 0 #{@unit} #{@convert} #{@text}\n" end |