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.
11
12
13
|
# File 'lib/lucie/validators/base.rb', line 11
def initialize(*args)
@argname = args.flatten
end
|
Instance Method Details
#apply(params) ⇒ Object
15
16
17
|
# File 'lib/lucie/validators/base.rb', line 15
def apply(params)
fail NotImplemented
end
|
#description ⇒ Object
27
28
29
|
# File 'lib/lucie/validators/base.rb', line 27
def description
@argname.select{|option| option[0] != "-" }.first
end
|
#long_option ⇒ Object
23
24
25
|
# File 'lib/lucie/validators/base.rb', line 23
def long_option
@argname.select{|option| option[0] == "-" && option[1] == "-"}.join.strip
end
|
#short_option ⇒ Object
19
20
21
|
# File 'lib/lucie/validators/base.rb', line 19
def short_option
@argname.select{|option| option[0] == "-" && option[1] != "-"}.join.strip
end
|