Class: Ruth::Gemfile::Hash
- Inherits:
-
Object
- Object
- Ruth::Gemfile::Hash
- Defined in:
- lib/ruth/hash.rb
Overview
Hash parser
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
writeonly
Sets the attribute data.
-
#file ⇒ Object
Returns the value of attribute file.
-
#gem ⇒ Object
Returns the value of attribute gem.
-
#gemfile ⇒ Object
Returns the value of attribute gemfile.
Instance Method Summary collapse
-
#initialize ⇒ Hash
constructor
A new instance of Hash.
-
#output ⇒ Object
Public - Generate Gemfile contents.
Constructor Details
#initialize ⇒ Hash
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
8 9 10 |
# File 'lib/ruth/hash.rb', line 8 def data=(value) @data = value end |
#file ⇒ Object
Returns the value of attribute file.
7 8 9 |
# File 'lib/ruth/hash.rb', line 7 def file @file end |
#gem ⇒ Object
Returns the value of attribute gem.
7 8 9 |
# File 'lib/ruth/hash.rb', line 7 def gem @gem end |
#gemfile ⇒ Object
Returns the value of attribute gemfile.
7 8 9 |
# File 'lib/ruth/hash.rb', line 7 def gemfile @gemfile end |
Instance Method Details
#output ⇒ Object
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 |