Class: Ppson::FileArgument

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filepath, options) ⇒ FileArgument

Returns a new instance of FileArgument.



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

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

Instance Attribute Details

#filepathObject (readonly)

Returns the value of attribute filepath.



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

def filepath
  @filepath
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#processObject



10
11
12
13
14
# File 'lib/ppjson/file_argument.rb', line 10

def process
  with_contents do |contents|
    writer.write(contents, :pretty => prettify?)
  end
end