Class: Line::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/line/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) {|_self| ... } ⇒ Options

Returns a new instance of Options.

Yields:

  • (_self)

Yield Parameters:

  • _self (Line::Options)

    the object that the method was called on



6
7
8
9
# File 'lib/line/options.rb', line 6

def initialize(attributes={})
  update attributes
  yield self if block_given?
end

Instance Attribute Details

#buffer_sizeObject

Returns the value of attribute buffer_size.



4
5
6
# File 'lib/line/options.rb', line 4

def buffer_size
  @buffer_size
end

#chompObject Also known as: chomp?

Returns the value of attribute chomp.



3
4
5
# File 'lib/line/options.rb', line 3

def chomp
  @chomp
end

#debugObject Also known as: debug?

Returns the value of attribute debug.



4
5
6
# File 'lib/line/options.rb', line 4

def debug
  @debug
end

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/line/options.rb', line 3

def errors
  @errors
end

#errstreamObject

Returns the value of attribute errstream.



4
5
6
# File 'lib/line/options.rb', line 4

def errstream
  @errstream
end

#forceObject Also known as: force?

Returns the value of attribute force.



3
4
5
# File 'lib/line/options.rb', line 3

def force
  @force
end

#help_screenObject

Returns the value of attribute help_screen.



4
5
6
# File 'lib/line/options.rb', line 4

def help_screen
  @help_screen
end

#indexesObject

Returns the value of attribute indexes.



3
4
5
# File 'lib/line/options.rb', line 3

def indexes
  @indexes
end

#instreamObject

Returns the value of attribute instream.



4
5
6
# File 'lib/line/options.rb', line 4

def instream
  @instream
end

#line_matcherObject

Returns the value of attribute line_matcher.



3
4
5
# File 'lib/line/options.rb', line 3

def line_matcher
  @line_matcher
end

#line_numbersObject Also known as: line_numbers?

Returns the value of attribute line_numbers.



3
4
5
# File 'lib/line/options.rb', line 3

def line_numbers
  @line_numbers
end

#outstreamObject

Returns the value of attribute outstream.



4
5
6
# File 'lib/line/options.rb', line 4

def outstream
  @outstream
end

#show_helpObject Also known as: show_help?

Returns the value of attribute show_help.



3
4
5
# File 'lib/line/options.rb', line 3

def show_help
  @show_help
end

#stripObject Also known as: strip?

Returns the value of attribute strip.



3
4
5
# File 'lib/line/options.rb', line 3

def strip
  @strip
end

Instance Method Details

#update(attributes) ⇒ Object



11
12
13
14
# File 'lib/line/options.rb', line 11

def update(attributes)
  attributes.each { |attribute, value| __send__ "#{attribute}=", value }
  self
end