Class: Nextcloud::Models::Directory

Inherits:
Object
  • Object
show all
Defined in:
lib/nextcloud/models/directory.rb

Overview

Directory model

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil, id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil, comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil, owner_display_name: nil, share_types: nil, skip_contents: false) ⇒ Directory

Initiates a model instance



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/nextcloud/models/directory.rb', line 45

def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
  id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
  comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
  owner_display_name: nil, share_types: nil, skip_contents: false)

  self.class.params.each do |v|
    instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
  end

  remove_instance_variable (:@skip_contents) if skip_contents
end

Class Attribute Details

.paramsObject (readonly)

Returns the value of attribute params.



61
62
63
# File 'lib/nextcloud/models/directory.rb', line 61

def params
  @params
end

Instance Attribute Details

#comments_countString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#comments_hrefString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#comments_unreadString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#contentlengthString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#contentsObject

Returns the value of attribute contents.



40
41
42
# File 'lib/nextcloud/models/directory.rb', line 40

def contents
  @contents
end

#contenttypeString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#favoriteString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#fileidString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#has_previewString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#hrefString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#idString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#lastmodifiedString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#metaObject

Returns the value of attribute meta.



40
41
42
# File 'lib/nextcloud/models/directory.rb', line 40

def meta
  @meta
end

#owner_display_nameString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#owner_idString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#permissionsString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#resourcetypeString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#share_typesString



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

#tagHash



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/nextcloud/models/directory.rb', line 39

class Directory
  attr_accessor :meta, :contents

  # Initiates a model instance
  #
  # @param [Hash]
  def initialize(href: nil, lastmodified: nil, tag: nil, resourcetype: nil, contenttype: nil, contentlength: nil,
    id: nil, fileid: nil, permissions: nil, size: nil, has_preview: nil, favorite: nil,
    comments_href: nil, comments_count: nil, comments_unread: nil, owner_id: nil,
    owner_display_name: nil, share_types: nil, skip_contents: false)

    self.class.params.each do |v|
      instance_variable_set("@#{v}", instance_eval(v.to_s)) if instance_eval(v.to_s)
    end

    remove_instance_variable (:@skip_contents) if skip_contents
  end

  @params = instance_method(:initialize).parameters.map(&:last)
  @params.each { |p| instance_eval("attr_accessor :#{p}") }

  class << self
    attr_reader :params
  end

  # Adds content to collection
  #
  # @param [Hash]
  # @return [Array] Contents array
  def add(args)
    @contents = [] if @contents.nil?
    @contents << self.class.new(args.merge(skip_contents: true))
  end
end

Instance Method Details

#add(args) ⇒ Array

Adds content to collection



68
69
70
71
# File 'lib/nextcloud/models/directory.rb', line 68

def add(args)
  @contents = [] if @contents.nil?
  @contents << self.class.new(args.merge(skip_contents: true))
end