Method: Unchained::Client::Mixins::Resource::ClassMethods#attribute

Defined in:
lib/unchained/client/mixins/resource.rb

#attribute(name, type, opts = {}) ⇒ Object



76
77
78
79
80
81
82
83
# File 'lib/unchained/client/mixins/resource.rb', line 76

def attribute(name, type, opts={})
  instance_eval do
    attr_accessor name
  end

  @attributes ||= []
  @attributes << Attribute.new(name, type, opts)
end