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.
5783 5784 5785 5786 5787 5788 5789 |
# File 'lib/models/porcelain.rb', line 5783 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.
5779 5780 5781 |
# File 'lib/models/porcelain.rb', line 5779 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
5781 5782 5783 |
# File 'lib/models/porcelain.rb', line 5781 def value @value end |
Instance Method Details
#to_json(options = {}) ⇒ Object
5791 5792 5793 5794 5795 5796 5797 |
# File 'lib/models/porcelain.rb', line 5791 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 |