Class: Transmission::Torrent::FileInfo

Inherits:
Object
  • Object
show all
Defined in:
ext/r_transmission.c,
lib/transmission.rb,
ext/r_transmission.c

Overview

Summary

The FileInfo class containts the information about a file which is part of this torrent.

Instance Method Summary collapse

Instance Method Details

#nameString

Returns the name of the file.

Returns:

  • (String)


752
753
754
755
756
757
758
# File 'ext/r_transmission.c', line 752

static VALUE
r_file_info_name(VALUE self)
{
    tr_file_t *file;
    Data_Get_Struct(self, tr_file_t, file);
    return rb_str_new2(file->name);
}

#sizeInteger

Returns the size of the file.

Returns:

  • (Integer)


766
767
768
769
770
771
772
# File 'ext/r_transmission.c', line 766

static VALUE
r_file_info_size(VALUE self)
{
    tr_file_t *file;
    Data_Get_Struct(self, tr_file_t, file);
    return INT2FIX(file->length);
}

#nameString

Returns the name of the file.

Returns:

  • (String)


752
753
754
755
756
757
758
# File 'ext/r_transmission.c', line 752

static VALUE
r_file_info_name(VALUE self)
{
    tr_file_t *file;
    Data_Get_Struct(self, tr_file_t, file);
    return rb_str_new2(file->name);
}

#sizeInteger

Returns the size of the file.

Returns:

  • (Integer)


766
767
768
769
770
771
772
# File 'ext/r_transmission.c', line 766

static VALUE
r_file_info_size(VALUE self)
{
    tr_file_t *file;
    Data_Get_Struct(self, tr_file_t, file);
    return INT2FIX(file->length);
}

#to_sObject



70
71
72
# File 'lib/transmission.rb', line 70

def to_s
  "FileInfo{name: %s, size: %d}" % [name, size]
end