class Proj::Operation
Attributes
description[R]
id[R]
Public Class Methods
get(id)
click to toggle source
# File lib/proj/operation.rb, line 18 def self.get(id) self.list.find {|operation| operation.id == id} end
list()
click to toggle source
# File lib/proj/operation.rb, line 5 def self.list pointer_to_array = FFI::Pointer.new(Api::PJ_LIST, Api.proj_list_operations) result = Array.new 0.step do |i| operation_info = Api::PJ_LIST.new(pointer_to_array[i]) break result if operation_info[:id].nil? id = operation_info[:id] description = operation_info[:descr].read_pointer.read_string.force_encoding('UTF-8') result << self.new(id, description) end result end
new(id, description)
click to toggle source
# File lib/proj/operation.rb, line 22 def initialize(id, description) @id = id @description = description end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/proj/operation.rb, line 27 def <=>(other) self.id <=> other.id end
==(other)
click to toggle source
# File lib/proj/operation.rb, line 31 def ==(other) self.id == other.id end
inspect()
click to toggle source
# File lib/proj/operation.rb, line 39 def inspect "#<#{self.class} id=\"#{id}\", major=\"#{major}\", ell=\"#{ell}\", name=\"#{name}\">" end
to_s()
click to toggle source
# File lib/proj/operation.rb, line 35 def to_s self.id end