Class: Ppson::Arguments

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ppjson/arguments.rb

Direct Known Subclasses

FileArguments, JsonArguments

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments, options) ⇒ Arguments

Returns a new instance of Arguments.



7
8
9
10
# File 'lib/ppjson/arguments.rb', line 7

def initialize(arguments, options)
  @arguments = arguments
  @options = options
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



5
6
7
# File 'lib/ppjson/arguments.rb', line 5

def arguments
  @arguments
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/ppjson/arguments.rb', line 5

def options
  @options
end

Instance Method Details

#argument_instance(argument_data, options) ⇒ Object



18
19
20
# File 'lib/ppjson/arguments.rb', line 18

def argument_instance(argument_data, options)
  raise "Must be implemented in child class"
end

#each(&block) ⇒ Object



12
13
14
15
16
# File 'lib/ppjson/arguments.rb', line 12

def each(&block)
  arguments.each do |argument|
    block.call(argument_instance(argument, options))
  end
end