Class: Rackson::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/rackson/property.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, klass, options) ⇒ Property

Returns a new instance of Property.



5
6
7
8
9
# File 'lib/rackson/property.rb', line 5

def initialize(name, klass, options)
  @name = name
  @klass = klass
  @options = options
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



3
4
5
# File 'lib/rackson/property.rb', line 3

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/rackson/property.rb', line 3

def name
  @name
end

Instance Method Details

#required?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rackson/property.rb', line 11

def required?
  !@options[:optional]
end