Class: JSON2Ruby::Primitive

Inherits:
Object
  • Object
show all
Defined in:
lib/json2ruby/primitive.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attr_hash) ⇒ Primitive

Returns a new instance of Primitive.



10
11
12
13
# File 'lib/json2ruby/primitive.rb', line 10

def initialize(name, attr_hash)
  @name = name
  @attr_hash = attr_hash
end

Instance Attribute Details

#attr_hashObject

Returns the value of attribute attr_hash.



4
5
6
# File 'lib/json2ruby/primitive.rb', line 4

def attr_hash
  @attr_hash
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/json2ruby/primitive.rb', line 4

def name
  @name
end

#original_nameObject

Returns the value of attribute original_name.



4
5
6
# File 'lib/json2ruby/primitive.rb', line 4

def original_name
  @original_name
end

Class Method Details

.short_nameObject



6
7
8
# File 'lib/json2ruby/primitive.rb', line 6

def self.short_name
  "Primitive"
end

Instance Method Details

#commentObject



19
20
21
# File 'lib/json2ruby/primitive.rb', line 19

def comment
  @name
end