Class: XCodeBuildHelper::Rules
- Inherits:
-
Object
- Object
- XCodeBuildHelper::Rules
- Defined in:
- lib/rules.rb
Instance Method Summary collapse
- #get_attribute_list ⇒ Object
-
#initialize ⇒ Rules
constructor
A new instance of Rules.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Rules
Returns a new instance of Rules.
3 4 5 |
# File 'lib/rules.rb', line 3 def initialize @attributes = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rules.rb', line 7 def method_missing(name, *args, &block) if name.to_s.start_with? "get_" @attributes[name.to_s.gsub(/get_/, '').to_sym] elsif name.to_s.start_with? "key_" if @attributes[name.to_s.gsub(/key_/, '').to_sym] name.to_s.gsub(/key_/, '').upcase end else @attributes[name] = args[0] end end |
Instance Method Details
#get_attribute_list ⇒ Object
19 20 21 |
# File 'lib/rules.rb', line 19 def get_attribute_list @attributes.keys end |