Class: KillBillClient::Model::TagDefinition
- Inherits:
-
TagDefinitionAttributes
- Object
- Resource
- TagDefinitionAttributes
- KillBillClient::Model::TagDefinition
- Defined in:
- lib/killbill_client/models/tag_definition.rb
Constant Summary collapse
- KILLBILL_API_TAG_DEFINITIONS_PREFIX =
"#{KILLBILL_API_PREFIX}/tagDefinitions"
Class Method Summary collapse
- .all(audit = 'NONE', options = {}) ⇒ Object
- .find_by_id(id, audit = 'NONE', options = {}) ⇒ Object
- .find_by_name(name, audit = 'NONE', options = {}) ⇒ Object
Instance Method Summary collapse
- #create(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
- #delete(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
Class Method Details
.all(audit = 'NONE', options = {}) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/killbill_client/models/tag_definition.rb', line 7 def all(audit = 'NONE', = {}) get KILLBILL_API_TAG_DEFINITIONS_PREFIX, { :audit => audit }, end |
.find_by_id(id, audit = 'NONE', options = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/killbill_client/models/tag_definition.rb', line 15 def find_by_id(id, audit = 'NONE', = {}) get "#{KILLBILL_API_TAG_DEFINITIONS_PREFIX}/#{id}", { :audit => audit }, end |
.find_by_name(name, audit = 'NONE', options = {}) ⇒ Object
23 24 25 |
# File 'lib/killbill_client/models/tag_definition.rb', line 23 def find_by_name(name, audit = 'NONE', = {}) self.all(audit, ).select { |tag_definition| tag_definition.name == name }.first end |
Instance Method Details
#create(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/killbill_client/models/tag_definition.rb', line 28 def create(user = nil, reason = nil, comment = nil, = {}) created_tag_definition = self.class.post KILLBILL_API_TAG_DEFINITIONS_PREFIX, to_json, {}, { :user => user, :reason => reason, :comment => comment, }.merge() created_tag_definition.refresh() end |
#delete(user = nil, reason = nil, comment = nil, options = {}) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/killbill_client/models/tag_definition.rb', line 40 def delete(user = nil, reason = nil, comment = nil, = {}) self.class.delete "#{KILLBILL_API_TAG_DEFINITIONS_PREFIX}/#{id}", to_json, {}, { :user => user, :reason => reason, :comment => comment, }.merge() end |