Module: HALDecorator::Attributes

Included in:
HALDecorator, Collection::CollectionParameters
Defined in:
lib/hal_decorator/attributes.rb

Instance Method Summary collapse

Instance Method Details

#attribute(*args, &block) ⇒ Object



5
6
7
8
9
# File 'lib/hal_decorator/attributes.rb', line 5

def attribute(*args, &block)
  @_attributes ||= init_attributes
  @_attributes = @_attributes.reject { |attr| attr.name == args.first }
  @_attributes << Property.new(*args, &block)
end