Class: Tinychef::Node
- Inherits:
-
Object
- Object
- Tinychef::Node
- Defined in:
- lib/tinychef/node.rb
Defined Under Namespace
Classes: NofileError
Constant Summary collapse
- EXT =
'.json'
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #host ⇒ Object
-
#initialize(name) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(name) ⇒ Node
Returns a new instance of Node.
12 13 14 15 16 |
# File 'lib/tinychef/node.rb', line 12 def initialize(name) @name = name normalize_name find_file end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/tinychef/node.rb', line 10 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/tinychef/node.rb', line 10 def path @path end |
Instance Method Details
#host ⇒ Object
18 19 20 |
# File 'lib/tinychef/node.rb', line 18 def host path.basename.to_s.gsub(EXT, '') end |