Class: GrADS::Command::LINE

Inherits:
Object
  • Object
show all
Defined in:
lib/grads/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#colorObject (readonly)

Returns the value of attribute color.



954
955
956
# File 'lib/grads/command.rb', line 954

def color
  @color
end

#typeObject (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_aObject



956
957
958
# File 'lib/grads/command.rb', line 956

def to_a
  return [@color, @type, @thickness]
end