Class: Evertils::Type
- Inherits:
-
Object
- Object
- Evertils::Type
- Defined in:
- lib/evertils/type.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(path) ⇒ Type
constructor
A new instance of Type.
Constructor Details
#initialize(path) ⇒ Type
Returns a new instance of Type.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/evertils/type.rb', line 9 def initialize(path) begin type_path = File.(path) contents = YAML.load_file(type_path) return if contents.empty? translate_variables(contents) @params = OpenStruct.new(contents) rescue Errno::ENOENT Notify.error("File doesn't exist - #{type_path}") end end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
7 8 9 |
# File 'lib/evertils/type.rb', line 7 def params @params end |