Class: Proj4::ProjXY

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/ffi-proj4/projxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ProjXY

Returns a new instance of ProjXY.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ffi-proj4/projxy.rb', line 9

def initialize(*args)
  case args.first
    when FFI::Pointer, FFI::Buffer
      super(*args)
    when FFI::Buffer
      super(*args)
    else
      if !args.empty?
        self[:x], self[:y] = args.map(&:to_f)
      end
  end
end

Instance Method Details

#xObject



30
31
32
# File 'lib/ffi-proj4/projxy.rb', line 30

def x
  self[:x]
end

#x=(v) ⇒ Object



22
23
24
# File 'lib/ffi-proj4/projxy.rb', line 22

def x=(v)
  self[:x] = v
end

#yObject



34
35
36
# File 'lib/ffi-proj4/projxy.rb', line 34

def y
  self[:y]
end

#y=(v) ⇒ Object



26
27
28
# File 'lib/ffi-proj4/projxy.rb', line 26

def y=(v)
  self[:y] = v
end