Class: PutioFs::PutFile

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/putio_fs/put_dir.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ops) ⇒ PutFile

Returns a new instance of PutFile.



27
28
29
30
31
# File 'lib/putio_fs/put_dir.rb', line 27

def initialize(ops)
  [:id, :name, :parent_id, :content_type, :put_dir].each do |m|
    send("#{m}=",ops[m.to_s])
  end
end

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



26
27
28
# File 'lib/putio_fs/put_dir.rb', line 26

def content_type
  @content_type
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/putio_fs/put_dir.rb', line 26

def id
  @id
end

#nameObject

Returns the value of attribute name.



26
27
28
# File 'lib/putio_fs/put_dir.rb', line 26

def name
  @name
end

#parent_idObject

Returns the value of attribute parent_id.



26
27
28
# File 'lib/putio_fs/put_dir.rb', line 26

def parent_id
  @parent_id
end

#put_dirObject

Returns the value of attribute put_dir.



26
27
28
# File 'lib/putio_fs/put_dir.rb', line 26

def put_dir
  @put_dir
end

Instance Method Details

#directory?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/putio_fs/put_dir.rb', line 32

def directory?
  content_type =~ /directory/
end

#file?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/putio_fs/put_dir.rb', line 35

def file?
  !directory?
end