Class: OptparseLite::Np

Inherits:
Object
  • Object
show all
Includes:
Lingual
Defined in:
lib/optparse-lite.rb

Instance Method Summary collapse

Methods included from Lingual

#methodize, #oxford_comma

Constructor Details

#initialize(art, root, count = nil, &block) ⇒ Np

Returns a new instance of Np.



951
952
953
954
955
956
# File 'lib/optparse-lite.rb', line 951

def initialize art, root, count=nil, &block
  fail('blah blah for now') if block_given? && ! block.arity.zero?
  fail('count and block mutually exclusive, one required') unless
    1 == [count, block].compact.size
  @art, @root, @block, @count, @list = art, root, block, count, nil
end

Instance Method Details

#to_strObject Also known as: to_s



957
958
959
960
961
# File 'lib/optparse-lite.rb', line 957

def to_str
  [ surface_article,
    surface_root,
    surface_items ].compact.join(' ')
end