Class: XCodeBuildHelper::Rules

Inherits:
Object
  • Object
show all
Defined in:
lib/rules.rb

Instance Method Summary collapse

Constructor Details

#initializeRules

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_listObject



19
20
21
# File 'lib/rules.rb', line 19

def get_attribute_list
  @attributes.keys
end