Class: Ea::Shapescript::Shape

Inherits:
Struct
  • Object
show all
Defined in:
lib/ea/shapescript/shape.rb

Overview

One rendered shape primitive. Carries type + params ready for SVG emission.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



7
8
9
# File 'lib/ea/shapescript/shape.rb', line 7

def kind
  @kind
end

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



7
8
9
# File 'lib/ea/shapescript/shape.rb', line 7

def params
  @params
end

Instance Method Details

#ellipse?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ea/shapescript/shape.rb', line 13

def ellipse?
  kind == :ellipse
end

#label?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/ea/shapescript/shape.rb', line 29

def label?
  kind == :label
end

#line?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ea/shapescript/shape.rb', line 21

def line?
  kind == :line
end

#path?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ea/shapescript/shape.rb', line 25

def path?
  kind == :path
end

#polygon?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/ea/shapescript/shape.rb', line 17

def polygon?
  kind == :polygon
end

#rectangle?Boolean

Returns true when this shape is a rectangle.

Returns:

  • (Boolean)

    true when this shape is a rectangle



9
10
11
# File 'lib/ea/shapescript/shape.rb', line 9

def rectangle?
  kind == :rectangle
end