Class: Ppson::ArgumentsDecorator

Inherits:
Object
  • Object
show all
Defined in:
lib/ppjson/arguments_decorator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments, options) ⇒ ArgumentsDecorator

Returns a new instance of ArgumentsDecorator.



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

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

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



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

def arguments
  @arguments
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#decorateObject



10
11
12
# File 'lib/ppjson/arguments_decorator.rb', line 10

def decorate
  options[:file] ? file_arguments : json_arguments
end