Class: Lucie::Validators::Base
- Inherits:
-
Object
- Object
- Lucie::Validators::Base
show all
- Defined in:
- lib/lucie/validators/base.rb
Instance Method Summary
collapse
Constructor Details
#initialize(*args) ⇒ Base
Returns a new instance of Base.
4
5
6
|
# File 'lib/lucie/validators/base.rb', line 4
def initialize(*args)
@argname = args.flatten
end
|
Instance Method Details
#apply(params) ⇒ Object
8
9
10
|
# File 'lib/lucie/validators/base.rb', line 8
def apply(params)
fail NotImplemented
end
|
#description ⇒ Object
20
21
22
|
# File 'lib/lucie/validators/base.rb', line 20
def description
@argname.select{|option| option[0] != "-" }.first
end
|
#long_option ⇒ Object
16
17
18
|
# File 'lib/lucie/validators/base.rb', line 16
def long_option
@argname.select{|option| option[0] == "-" && option[1] == "-"}.join.strip
end
|
#short_option ⇒ Object
12
13
14
|
# File 'lib/lucie/validators/base.rb', line 12
def short_option
@argname.select{|option| option[0] == "-" && option[1] != "-"}.join.strip
end
|