Skip to content

Commit

Permalink
job_id instance method
Browse files Browse the repository at this point in the history
  • Loading branch information
m0wfo committed Feb 16, 2009
1 parent bcd2739 commit 2ca40fb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Makefile
*.so
pkg
doc
.DS_Store
.DS_Store
test.rb
Binary file modified cups.bundle
Binary file not shown.
6 changes: 6 additions & 0 deletions cups.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,18 @@ static VALUE cups_get_default(VALUE self) {
}
}

static VALUE cups_job_id(VALUE self) {
VALUE job_id = rb_iv_get(self, "@job_id");
return job_id;
}

VALUE printJobs;

void Init_cups() {
printJobs = rb_define_class("PrintJob", rb_cObject);
rb_define_method(printJobs, "initialize", job_init, 2);
rb_define_method(printJobs, "print", cups_print, 0);
rb_define_method(printJobs, "job_id", cups_job_id, 0);
rb_define_singleton_method(printJobs, "show_destinations", cups_show_dests, 0);
rb_define_singleton_method(printJobs, "default_printer", cups_get_default, 0);
id_push = rb_intern("push");
Expand Down
Binary file modified cups.o
Binary file not shown.
12 changes: 12 additions & 0 deletions test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require "cups"

pj = PrintJob.new("/Users/chris/Documents/hash_server.rb", 'soft_class')

# p pj.inspect

# p PrintJob.show_destinations
# p PrintJob.default_printer

# pj.print
p pj.inspect
p pj.job_id

0 comments on commit 2ca40fb

Please sign in to comment.