Module: NHKore::Fileable

Included in:
News, SearchLinks, Sifter
Defined in:
lib/nhkore/fileable.rb

Overview

Author:

  • Jonathan Bradley Whited

Since:

  • 0.2.0

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object

Since:

  • 0.2.0



18
19
20
# File 'lib/nhkore/fileable.rb', line 18

def self.included(mod)
  mod.extend ClassMethods
end

Instance Method Details

#save_file(file, mode: 'wt', **kargs) ⇒ Object

Since:

  • 0.2.0



22
23
24
25
26
# File 'lib/nhkore/fileable.rb', line 22

def save_file(file,mode: 'wt',**kargs)
  File.open(file,mode: mode,**kargs) do |f|
    f.write(to_s)
  end
end