Class: GitRoom::Admin

Inherits:
Object show all
Defined in:
lib/gitroom/admin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#listObject

Returns the value of attribute list.



9
10
11
# File 'lib/gitroom/admin.rb', line 9

def list
  @list
end

Instance Method Details

#deleteObject



19
20
21
# File 'lib/gitroom/admin.rb', line 19

def delete
  @list.each { |x| x.destroy }
end

#find(regex_string = '') ⇒ Object



11
12
13
# File 'lib/gitroom/admin.rb', line 11

def find(regex_string = '')
  @list = Node.where 'path ~ ?', regex_string
end

#logsObject



23
24
25
# File 'lib/gitroom/admin.rb', line 23

def logs
  Log.pluck :data
end

#logs!Object



27
28
29
30
31
# File 'lib/gitroom/admin.rb', line 27

def logs!
  res = logs
  Log.destroy_all
  res
end

#pluckObject



15
16
17
# File 'lib/gitroom/admin.rb', line 15

def pluck
  @list.pluck :path
end