Module: RHC::Rest::AttributesClass
- Included in:
- Base
- Defined in:
- lib/rhc/rest/attributes.rb
Instance Method Summary collapse
Instance Method Details
#define_attr(*names) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rhc/rest/attributes.rb', line 21 def define_attr(*names) names.map(&:to_sym).each do |name| define_method(name) do attribute(name) end define_method("#{name}=") do |value| instance_variable_set(:"@#{name}", nil) attributes[name.to_s] = value end end end |
#model_name ⇒ Object
33 34 35 |
# File 'lib/rhc/rest/attributes.rb', line 33 def model_name name.split("::").last end |