Class: Ayadn::Set

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

Instance Method Summary collapse

Instance Method Details

#backup(*args) ⇒ Object



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/ayadn/set.rb', line 160

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

#blacklist(*args) ⇒ Object



70
71
72
73
74
75
76
77
78
79
# File 'lib/ayadn/set.rb', line 70

def blacklist(*args)
  blacklist_config = SetBlacklist.new
  unless args.length != 2
    blacklist_config.send(args[0], args[1])
  else
    Status.new.error_missing_parameters
    exit
  end
  blacklist_config.save
end

#channels(*args) ⇒ Object



58
59
60
61
62
63
64
65
66
67
# File 'lib/ayadn/set.rb', line 58

def channels(*args)
  channels_config = SetChannels.new
  unless args.length != 2
    channels_config.send(args[0], args[1])
  else
    Status.new.error_missing_parameters
    exit
  end
  channels_config.save
end

#color(*args) ⇒ Object



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/ayadn/set.rb', line 140

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

#count(*args) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/ayadn/set.rb', line 117

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

#defaultsObject



180
181
182
183
# File 'lib/ayadn/set.rb', line 180

def defaults
  Settings.restore_defaults
  Status.new.done
end

#formats(*args) ⇒ Object



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/ayadn/set.rb', line 186

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

#marker(*args) ⇒ Object



45
46
47
48
49
50
51
52
53
54
# File 'lib/ayadn/set.rb', line 45

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

#movie(*args) ⇒ Object



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

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

#nicerank(*args) ⇒ Object



83
84
85
86
87
88
89
90
91
92
# File 'lib/ayadn/set.rb', line 83

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

#scroll(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# 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
    Status.new.error_missing_parameters
    exit
  end
  scroll_config.save
end

#timeline(*args) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/ayadn/set.rb', line 96

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

#tvshow(*args) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/ayadn/set.rb', line 32

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