Class: Ruth::Gemfile::Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/ruth/hash.rb

Overview

Hash parser

Direct Known Subclasses

Yaml

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHash

Returns a new instance of Hash.



10
11
12
# File 'lib/ruth/hash.rb', line 10

def initialize
  @gem = []
end

Instance Attribute Details

#data=(value) ⇒ Object (writeonly)

Sets the attribute data

Parameters:

  • value

    the value to set the attribute data to.



8
9
10
# File 'lib/ruth/hash.rb', line 8

def data=(value)
  @data = value
end

#fileObject

Returns the value of attribute file.



7
8
9
# File 'lib/ruth/hash.rb', line 7

def file
  @file
end

#gemObject

Returns the value of attribute gem.



7
8
9
# File 'lib/ruth/hash.rb', line 7

def gem
  @gem
end

#gemfileObject

Returns the value of attribute gemfile.



7
8
9
# File 'lib/ruth/hash.rb', line 7

def gemfile
  @gemfile
end

Instance Method Details

#outputObject

Public - Generate Gemfile contents

Returns Array



17
18
19
20
# File 'lib/ruth/hash.rb', line 17

def output
  parse_gemfile_item
  @gem.join("\n")
end