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.
7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 |
# File 'lib/models/porcelain.rb', line 7423 def initialize( name: nil, value: nil ) if name != nil @name = name end if value != nil @value = value end end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7419 7420 7421 |
# File 'lib/models/porcelain.rb', line 7419 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
7421 7422 7423 |
# File 'lib/models/porcelain.rb', line 7421 def value @value end |
Instance Method Details
#to_json(options = {}) ⇒ Object
7435 7436 7437 7438 7439 7440 7441 |
# File 'lib/models/porcelain.rb', line 7435 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 |