Class: MotionPlot::Axis

Inherits:
Object
  • Object
show all
Defined in:
lib/motion-plot/utilities/axis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Axis

Returns a new instance of Axis.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/motion-plot/utilities/axis.rb', line 5

def initialize(args)
  args.each_pair {|key, value|
    send("#{key}=", value) if(respond_to?("#{key}="))
  }

  if(args[:title])
    @title = Title.new(args[:title])
  end

  if(args[:style])
    @style = Style.new(args[:style])
  else
    @style = Style.new
  end
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



3
4
5
# File 'lib/motion-plot/utilities/axis.rb', line 3

def enabled
  @enabled
end

#labelsObject

Returns the value of attribute labels.



3
4
5
# File 'lib/motion-plot/utilities/axis.rb', line 3

def labels
  @labels
end

#styleObject

Returns the value of attribute style.



3
4
5
# File 'lib/motion-plot/utilities/axis.rb', line 3

def style
  @style
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/motion-plot/utilities/axis.rb', line 3

def title
  @title
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/motion-plot/utilities/axis.rb', line 3

def type
  @type
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/motion-plot/utilities/axis.rb', line 33

def enabled?
  enabled
end

#is_x?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/motion-plot/utilities/axis.rb', line 25

def is_x?
  type == "xaxis"
end

#is_y?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/motion-plot/utilities/axis.rb', line 29

def is_y?
  type == "yaxis"
end

#text_styleObject



21
22
23
# File 'lib/motion-plot/utilities/axis.rb', line 21

def text_style
  TextStyle.cpt_text_style(@style)
end