class SimpleObjects::Attribute

Attributes

default[RW]
name[RW]
required[RW]
type[RW]

Public Class Methods

new(name, opts = {}) click to toggle source
# File lib/simple_objects/attribute.rb, line 5
def initialize(name, opts = {})
  @name = name
  @required = false
  apply_opts(opts)
end

Private Instance Methods

apply_opts(opts) click to toggle source
# File lib/simple_objects/attribute.rb, line 13
def apply_opts(opts)
  opts.each do |opt, value|
    send("#{opt}=", value) if respond_to?(opt)
  end
end