Class: SimpleObjects::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_objects/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, opts = {}) ⇒ Attribute

Returns a new instance of Attribute.



5
6
7
8
9
# File 'lib/simple_objects/attribute.rb', line 5

def initialize(name, opts = {})
  @name = name
  @required = false
  apply_opts(opts)
end

Instance Attribute Details

#defaultObject

Returns the value of attribute default.



3
4
5
# File 'lib/simple_objects/attribute.rb', line 3

def default
  @default
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/simple_objects/attribute.rb', line 3

def name
  @name
end

#requiredObject

Returns the value of attribute required.



3
4
5
# File 'lib/simple_objects/attribute.rb', line 3

def required
  @required
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/simple_objects/attribute.rb', line 3

def type
  @type
end