Class: Swarker::Readers::FileReader

Inherits:
Object
  • Object
show all
Defined in:
lib/swarker/readers/file_reader.rb

Constant Summary collapse

JSON_EXT =
'.json'.freeze
YAML_EXT =
'.yml'.freeze
ERB_EXT =
'.erb'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileReader

Returns a new instance of FileReader.



14
15
16
# File 'lib/swarker/readers/file_reader.rb', line 14

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/swarker/readers/file_reader.rb', line 8

def path
  @path
end

Instance Method Details

#readObject



18
19
20
# File 'lib/swarker/readers/file_reader.rb', line 18

def read
  HashWithIndifferentAccess.new(readed_hash)
end