Class: Pauper::Config::Node
- Inherits:
-
Object
- Object
- Pauper::Config::Node
- Defined in:
- lib/pauper.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pretty_name ⇒ Object
readonly
Returns the value of attribute pretty_name.
Instance Method Summary collapse
- #chef_options(options) ⇒ Object
- #cpus(count) ⇒ Object
-
#initialize(name, pretty_name, &block) ⇒ Node
constructor
A new instance of Node.
- #ip(addr) ⇒ Object
- #last_octet(octet) ⇒ Object
- #optional(v = true) ⇒ Object
- #ram(megabytes) ⇒ Object
- #release(release_s) ⇒ Object
- #run_list(*recipes) ⇒ Object
Constructor Details
#initialize(name, pretty_name, &block) ⇒ Node
Returns a new instance of Node.
773 774 775 776 777 778 779 780 781 782 783 |
# File 'lib/pauper.rb', line 773 def initialize(name, pretty_name, &block) @name = name @pretty_name = pretty_name @config = { :run_list => [], :chef_options => {}, :release => :lucid, :optional => false, } instance_eval &block end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
771 772 773 |
# File 'lib/pauper.rb', line 771 def config @config end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
771 772 773 |
# File 'lib/pauper.rb', line 771 def name @name end |
#pretty_name ⇒ Object (readonly)
Returns the value of attribute pretty_name.
771 772 773 |
# File 'lib/pauper.rb', line 771 def pretty_name @pretty_name end |
Instance Method Details
#chef_options(options) ⇒ Object
797 798 799 |
# File 'lib/pauper.rb', line 797 def () @config[:chef_options] = end |
#cpus(count) ⇒ Object
805 806 807 |
# File 'lib/pauper.rb', line 805 def cpus(count) @config[:cpus] = count end |
#ip(addr) ⇒ Object
789 790 791 |
# File 'lib/pauper.rb', line 789 def ip(addr) @config[:ip] = addr end |
#last_octet(octet) ⇒ Object
793 794 795 |
# File 'lib/pauper.rb', line 793 def last_octet(octet) @config[:last_octet] = octet.to_s end |
#optional(v = true) ⇒ Object
813 814 815 |
# File 'lib/pauper.rb', line 813 def optional(v=true) @config[:optional] = v end |
#ram(megabytes) ⇒ Object
801 802 803 |
# File 'lib/pauper.rb', line 801 def ram(megabytes) @config[:ram] = megabytes end |
#release(release_s) ⇒ Object
809 810 811 |
# File 'lib/pauper.rb', line 809 def release(release_s) @config[:release] = Pauper.grok_release(release_s) end |
#run_list(*recipes) ⇒ Object
785 786 787 |
# File 'lib/pauper.rb', line 785 def run_list(*recipes) @config[:run_list] = recipes end |