Class: RGhost::Point

Inherits:
PsObject show all
Defined in:
lib/rghost/point.rb

Overview

Creates one point using default unit defined in RGhost::Config::GS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PsObject

#<<, #call, #graphic_scope, #raw, #set, #to_s

Constructor Details

#initialize(x, y) ⇒ Point

Returns a new instance of Point.



8
9
10
11
12
13
14
15
# File 'lib/rghost/point.rb', line 8

def initialize(x,y)
  if x.is_a? Hash
    point=x
    @x,@y=point[:x],point[:y]
  else
    @x,@y=x,y
  end
end

Instance Attribute Details

#xObject

Returns the value of attribute x.



6
7
8
# File 'lib/rghost/point.rb', line 6

def x
  @x
end

#yObject

Returns the value of attribute y.



6
7
8
# File 'lib/rghost/point.rb', line 6

def y
  @y
end

Instance Method Details

#psObject



17
18
19
# File 'lib/rghost/point.rb', line 17

def ps
  "#{RGhost::Units::parse(@x)} #{RGhost::Units::parse(@y)} "
end