Class: LolFramework::Common
- Inherits:
-
Object
- Object
- LolFramework::Common
show all
- Defined in:
- lib/lol_framework/common.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.defaulted_attributes(attributes) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/lol_framework/common.rb', line 8
def self.defaulted_attributes(attributes)
attributes.each do |attr, default|
attr_writer attr
define_method(attr) do
variable = instance_variable_get("@#{attr}")
variable ||= default if variable.nil?
variable
end
end
end
|
Instance Method Details
#iterate! {|_self| ... } ⇒ Object
4
5
6
|
# File 'lib/lol_framework/common.rb', line 4
def iterate!
yield self if block_given?
end
|