Module: UTorrent::Base

Included in:
File, Torrent
Defined in:
lib/u_torrent/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_arrayObject (readonly)

Returns the value of attribute raw_array.



3
4
5
# File 'lib/u_torrent/base.rb', line 3

def raw_array
  @raw_array
end

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/u_torrent/base.rb', line 9

def self.included(base)
  base.class_eval do
    base::ATTRIBUTES.each_with_index do |attr_name, i|
      unless attr_name.nil?
        define_method attr_name do
          @raw_array[i]
        end
      end
    end
  end
end

Instance Method Details

#initialize(array) ⇒ Object



5
6
7
# File 'lib/u_torrent/base.rb', line 5

def initialize(array)
  @raw_array = array
end