Class: JSON::Encodable::Property

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Property

Returns a new instance of Property.

Parameters:

  • name (Symbol)
  • options (Hash{Symbol => Object}) (defaults to: {})


12
13
14
15
# File 'lib/json/encodable/property.rb', line 12

def initialize(name, options = {})
  @name = name
  @options = options
end

Instance Attribute Details

#nameSymbol (readonly)

Returns:

  • (Symbol)


5
6
7
# File 'lib/json/encodable/property.rb', line 5

def name
  @name
end

#optionsHash{Symbol => Object} (readonly)

Returns:

  • (Hash{Symbol => Object})


8
9
10
# File 'lib/json/encodable/property.rb', line 8

def options
  @options
end