Class: Ayadn::Set

Inherits:
Thor
  • Object
show all
Defined in:
lib/ayadn/set.rb

Instance Method Summary collapse

Instance Method Details

#backup(*args) ⇒ Object



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/ayadn/set.rb', line 127

def backup(*args)
  backup_config = SetBackup.new
  if args[0]
    begin
      backup_config.send(args[0], args[1])
    rescue NoMethodError, ArgumentError
      puts Status.error_missing_parameters
      exit
    rescue => e
      raise e
    end
  else
    abort(Status.error_missing_parameters)
  end
  backup_config.save
end

#color(*args) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/ayadn/set.rb', line 108

def color(*args)
  color_config = SetColor.new
  if args[0]
    begin
      color_config.send(args[0], args[1])
    rescue NoMethodError, ArgumentError
      puts Status.error_missing_parameters
      exit
    rescue => e
      raise e
    end
  else
    abort(Status.error_missing_parameters)
  end
  color_config.save
end

#count(*args) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/ayadn/set.rb', line 86

def count(*args)
  counts_config = SetCounts.new
  if args[0]
    begin
      counts_config.send(args[0], args[1])
    rescue NoMethodError, ArgumentError
      puts Status.error_missing_parameters
      exit
    rescue => e
      raise e
    end
  else
    abort(Status.error_missing_parameters)
  end
  counts_config.save
end

#defaultsObject



146
147
148
149
# File 'lib/ayadn/set.rb', line 146

def defaults
  Settings.restore_defaults
  puts Status.done
end

#formats(*args) ⇒ Object



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/ayadn/set.rb', line 152

def formats(*args)
  formats_config = SetFormats.new
  if args[0]
    begin
      command = args.shift
      formats_config.send(command, args)
    rescue NoMethodError, ArgumentError
      puts Status.error_missing_parameters
      exit
    rescue => e
      raise e
    end
  else
    abort(Status.error_missing_parameters)
  end
  formats_config.save
end

#marker(*args) ⇒ Object



42
43
44
45
46
47
48
49
50
# File 'lib/ayadn/set.rb', line 42

def marker(*args)
  marker_config = SetMarker.new
  unless args.length != 2
    marker_config.send(args[0], args[1])
  else
    abort(Status.error_missing_parameters)
  end
  marker_config.save
end

#movie(*args) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/ayadn/set.rb', line 18

def movie(*args)
  movie_config = SetMovie.new
  unless args.length != 2
    movie_config.send(args[0], args[1])
  else
    abort(Status.error_missing_parameters)
  end
  movie_config.save
end

#nicerank(*args) ⇒ Object



54
55
56
57
58
59
60
61
62
# File 'lib/ayadn/set.rb', line 54

def nicerank *args
  nicerank_config = SetNiceRank.new
  if args[0]
    nicerank_config.send(args[0], args[1])
  else
    abort(Status.error_missing_parameters)
  end
  nicerank_config.save
end

#scroll(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/ayadn/set.rb', line 6

def scroll(*args)
  scroll_config = SetScroll.new
  if args[0]
    scroll_config.send(args[0], args[1])
  else
    abort(Status.error_missing_parameters)
  end
  scroll_config.save
end

#timeline(*args) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/ayadn/set.rb', line 66

def timeline(*args)
  timeline_config = SetTimeline.new
  if args[0]
    begin
      timeline_config.send(args[0], args[1])
    rescue NoMethodError, ArgumentError
      puts Status.error_missing_parameters
      exit
    rescue => e
      raise e
    end
  else
    abort(Status.error_missing_parameters)
  end
  timeline_config.save
end

#tvshow(*args) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/ayadn/set.rb', line 30

def tvshow(*args)
  tvshow_config = SetTVShow.new
  unless args.length != 2
    tvshow_config.send(args[0], args[1])
  else
    abort(Status.error_missing_parameters)
  end
  tvshow_config.save
end