Class: Mortar::Project::ProjectEntity

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/mortar/project.rb

Direct Known Subclasses

ControlScripts, LuigiScripts, PigScripts, PythonUDFs

Instance Method Summary collapse

Constructor Details

#initialize(path, name, filename_extension, optional = false) ⇒ ProjectEntity

Returns a new instance of ProjectEntity.



108
109
110
111
112
113
114
# File 'lib/mortar/project.rb', line 108

def initialize(path, name, filename_extension, optional=false)
  @path = path
  @name = name
  @filename_extension = filename_extension
  @optional = optional
  @elements = elements
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



116
117
118
119
120
# File 'lib/mortar/project.rb', line 116

def method_missing(method, *args)
  method_name = method.to_s
  return @elements[method_name] if @elements[method_name]
  super
end

Instance Method Details

#[](key) ⇒ Object



126
127
128
# File 'lib/mortar/project.rb', line 126

def [](key)
  @elements[key]
end

#eachObject



122
123
124
# File 'lib/mortar/project.rb', line 122

def each
  @elements.each {|key, value| yield [key, value]}
end

#keysObject



130
131
132
# File 'lib/mortar/project.rb', line 130

def keys
  @elements.keys
end