Class: GrADS::Command::LINE
- Inherits:
-
Object
- Object
- GrADS::Command::LINE
- Defined in:
- lib/grads/command.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type = 1, color: 1, thickness: 3) ⇒ LINE
constructor
A new instance of LINE.
- #to_a ⇒ Object
Constructor Details
#initialize(type = 1, color: 1, thickness: 3) ⇒ LINE
Returns a new instance of LINE.
931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 |
# File 'lib/grads/command.rb', line 931 def initialize (type = 1, color: 1, thickness: 3) case type when "","solid" @type = 1 when "--", "long dash" @type = 2 when "-", "short dash" @type = 3 when "-- -", "long dash short dash" @type = 4 when ".", "dotted" @type = 5 when ". -", "dot dash" @type = 6 when ". . -", "dot dot dash" @type = 7 else @type = type end @color = color @thickness = thickness end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
954 955 956 |
# File 'lib/grads/command.rb', line 954 def color @color end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
954 955 956 |
# File 'lib/grads/command.rb', line 954 def type @type end |
Instance Method Details
#to_a ⇒ Object
956 957 958 |
# File 'lib/grads/command.rb', line 956 def to_a return [@color, @type, @thickness] end |