Class: Ing::Option

Inherits:
Struct
  • Object
show all
Defined in:
lib/ing/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Option

Returns a new instance of Option.



197
198
199
200
# File 'lib/ing/task.rb', line 197

def initialize(*args)
  super
  self.opts ||= {}
end

Instance Attribute Details

#descObject

Returns the value of attribute desc

Returns:

  • (Object)

    the current value of desc



195
196
197
# File 'lib/ing/task.rb', line 195

def desc
  @desc
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



195
196
197
# File 'lib/ing/task.rb', line 195

def name
  @name
end

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts



195
196
197
# File 'lib/ing/task.rb', line 195

def opts
  @opts
end

Instance Method Details

#defaultObject



202
# File 'lib/ing/task.rb', line 202

def default; opts[:default]; end

#default=(val) ⇒ Object



203
204
205
# File 'lib/ing/task.rb', line 203

def default=(val)
  opts[:default] = val
end

#longObject



217
# File 'lib/ing/task.rb', line 217

def long; opts[:long]; end

#long=(val) ⇒ Object



218
219
220
# File 'lib/ing/task.rb', line 218

def long=(val)
  opts[:long] = val
end

#multiObject



212
# File 'lib/ing/task.rb', line 212

def multi; opts[:multi]; end

#multi=(val) ⇒ Object



213
214
215
# File 'lib/ing/task.rb', line 213

def multi=(val)
  opts[:multi] = val
end

#shortObject



222
# File 'lib/ing/task.rb', line 222

def short; opts[:short]; end

#short=(val) ⇒ Object



223
224
225
# File 'lib/ing/task.rb', line 223

def short=(val)
  opts[:short] = val
end

#to_argsObject



227
228
229
# File 'lib/ing/task.rb', line 227

def to_args
  [name, desc, opts]
end

#typeObject



207
# File 'lib/ing/task.rb', line 207

def type; opts[:type]; end

#type=(val) ⇒ Object



208
209
210
# File 'lib/ing/task.rb', line 208

def type=(val)
  opts[:type] = val
end