Class: Wikidotrb::Module::SearchPagesQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/wikidotrb/module/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pagetype: "*", category: "*", tags: nil, parent: nil, link_to: nil, created_at: nil, updated_at: nil, created_by: nil, rating: nil, votes: nil, name: nil, fullname: nil, range: nil, order: "created_at desc", offset: 0, limit: nil, perPage: 250, separate: "no", wrapper: "no") ⇒ SearchPagesQuery

Returns a new instance of SearchPagesQuery.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/wikidotrb/module/page.rb', line 43

def initialize(pagetype: "*", category: "*", tags: nil, parent: nil, link_to: nil, created_at: nil, updated_at: nil,
               created_by: nil, rating: nil, votes: nil, name: nil, fullname: nil, range: nil, order: "created_at desc",
               offset: 0, limit: nil, perPage: 250, separate: "no", wrapper: "no")
  @pagetype = pagetype
  @category = category
  @tags = tags
  @parent = parent
  @link_to = link_to
  @created_at = created_at
  @updated_at = updated_at
  @created_by = created_by
  @rating = rating
  @votes = votes
  @name = name
  @fullname = fullname
  @range = range
  @order = order
  @offset = offset
  @limit = limit
  @perPage = perPage
  @separate = separate
  @wrapper = wrapper
end

Instance Attribute Details

#category

Returns the value of attribute category.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def category
  @category
end

#created_at

Returns the value of attribute created_at.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def created_at
  @created_at
end

#created_by

Returns the value of attribute created_by.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def created_by
  @created_by
end

#fullname

Returns the value of attribute fullname.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def fullname
  @fullname
end

#limit

Returns the value of attribute limit.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def limit
  @limit
end

Returns the value of attribute link_to.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def link_to
  @link_to
end

#name

Returns the value of attribute name.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def name
  @name
end

#offset

Returns the value of attribute offset.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def offset
  @offset
end

#order

Returns the value of attribute order.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def order
  @order
end

#pagetype

Returns the value of attribute pagetype.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def pagetype
  @pagetype
end

#parent

Returns the value of attribute parent.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def parent
  @parent
end

#perPage

Returns the value of attribute perPage.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def perPage
  @perPage
end

#range

Returns the value of attribute range.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def range
  @range
end

#rating

Returns the value of attribute rating.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def rating
  @rating
end

#separate

Returns the value of attribute separate.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def separate
  @separate
end

#tags

Returns the value of attribute tags.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def tags
  @tags
end

#updated_at

Returns the value of attribute updated_at.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def updated_at
  @updated_at
end

#votes

Returns the value of attribute votes.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def votes
  @votes
end

#wrapper

Returns the value of attribute wrapper.



39
40
41
# File 'lib/wikidotrb/module/page.rb', line 39

def wrapper
  @wrapper
end

Instance Method Details

#to_h



67
68
69
70
71
72
# File 'lib/wikidotrb/module/page.rb', line 67

def to_h
  res = instance_variables.to_h { |var| [var.to_s.delete("@"), instance_variable_get(var)] }
  res.compact!
  res["tags"] = res["tags"].join(" ") if res["tags"].is_a?(Array)
  res
end