Module: Pivotal::Attributes::ClassMethods

Defined in:
lib/pivotal/attributes.rb

Instance Method Summary collapse

Instance Method Details

#has_attributes(*attributes) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/pivotal/attributes.rb', line 13

def has_attributes(*attributes)
  @attributes = attributes.map { |attribute| attribute.to_s }
  
  attributes.each do |attribute|
    define_method attribute do
      parsed_resource.xpath("*/" + attribute.to_s).text
    end
  end
end