Class: Netbout::Tags
- Inherits:
-
Object
- Object
- Netbout::Tags
- Defined in:
- lib/netbout/tags.rb
Overview
Tags.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
-
#initialize(iri, token, id) ⇒ Tags
constructor
A new instance of Tags.
- #put(key, value) ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(iri, token, id) ⇒ Tags
Returns a new instance of Tags.
31 32 33 34 35 |
# File 'lib/netbout/tags.rb', line 31 def initialize(iri, token, id) @iri = iri @token = token @id = id end |
Instance Method Details
#put(key, value) ⇒ Object
41 42 43 44 |
# File 'lib/netbout/tags.rb', line 41 def put(key, value) Netbout::Http.new(@iri.append('/b').append(@id).append('/tag'), @token) .post('name' => key, 'value' => value) end |
#to_a ⇒ Object
37 38 39 |
# File 'lib/netbout/tags.rb', line 37 def to_a JSON.parse(Netbout::Http.new(@iri.append('/tags').append(@id), @token).get.response_body) end |