Module: Liner::Base

Defined in:
lib/liner/base.rb

Instance Method Summary collapse

Instance Method Details

#initialize(*args) ⇒ Class

Create a new instance of a Liner class

Parameters:

  • args (Hash, Array, nil)

    A hash of attribute-value pairs, an array of values or nil

Returns:

  • (Class)

    A new instance of the Liner class



6
7
8
9
10
11
12
# File 'lib/liner/base.rb', line 6

def initialize(*args)
  if args.count == 1 && args.first.respond_to?(:keys)
    self.liner = args.first
  elsif args.count >= 1 && args.count <= liner_keys.count
    self.liner_values = args
  end
end