Class: InventosStreak::Field
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Methods inherited from Base
all, #attributes, belongs_to, children, #destroy, #final_path, find, has_many, #initialize, parent, parents, #save, #set_variables
Constructor Details
This class inherits a constructor from InventosStreak::Base
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
2 3 4 |
# File 'lib/inventos_streak/field.rb', line 2 def key @key end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/inventos_streak/field.rb', line 2 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/inventos_streak/field.rb', line 2 def type @type end |
Instance Method Details
#add_tags(*tags) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/inventos_streak/field.rb', line 6 def * if self.type == "TAG" InventosStreak.post_json self.final_path, { tagSettings: { tags: .map do |tag| { tag: tag, added: true } end } } else raise ArgumentError.new("Cannot add tags to a field not of type 'TAG'") end end |