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.



185
186
187
188
# File 'lib/ing/task.rb', line 185

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

Instance Attribute Details

#descObject

Returns the value of attribute desc

Returns:

  • (Object)

    the current value of desc



183
184
185
# File 'lib/ing/task.rb', line 183

def desc
  @desc
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



183
184
185
# File 'lib/ing/task.rb', line 183

def name
  @name
end

#optsObject

Returns the value of attribute opts

Returns:

  • (Object)

    the current value of opts



183
184
185
# File 'lib/ing/task.rb', line 183

def opts
  @opts
end

Instance Method Details

#defaultObject



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

def default; opts[:default]; end

#default=(val) ⇒ Object



191
192
193
# File 'lib/ing/task.rb', line 191

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

#longObject



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

def long; opts[:long]; end

#long=(val) ⇒ Object



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

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

#multiObject



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

def multi; opts[:multi]; end

#multi=(val) ⇒ Object



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

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

#shortObject



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

def short; opts[:short]; end

#short=(val) ⇒ Object



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

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

#to_argsObject



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

def to_args
  [name, desc, opts]
end

#typeObject



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

def type; opts[:type]; end

#type=(val) ⇒ Object



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

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