Class: SDM::Tag
- Inherits:
-
Object
- Object
- SDM::Tag
- Defined in:
- lib/models/porcelain.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name: nil, value: nil) ⇒ Tag
constructor
A new instance of Tag.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(name: nil, value: nil) ⇒ Tag
Returns a new instance of Tag.
6499 6500 6501 6502 6503 6504 6505 |
# File 'lib/models/porcelain.rb', line 6499 def initialize( name: nil, value: nil ) @name = name == nil ? "" : name @value = value == nil ? "" : value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6495 6496 6497 |
# File 'lib/models/porcelain.rb', line 6495 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
6497 6498 6499 |
# File 'lib/models/porcelain.rb', line 6497 def value @value end |
Instance Method Details
#to_json(options = {}) ⇒ Object
6507 6508 6509 6510 6511 6512 6513 |
# File 'lib/models/porcelain.rb', line 6507 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |