Class: KillBillClient::Model::TagDefinition
- Inherits:
-
TagDefinitionAttributes
- Object
- Resource
- TagDefinitionAttributes
- KillBillClient::Model::TagDefinition
- Includes:
- AuditLogWithHistoryHelper
- 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
Methods included from AuditLogWithHistoryHelper
Class Method Details
.all(audit = 'NONE', options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/killbill_client/models/tag_definition.rb', line 12 def all(audit = 'NONE', = {}) get KILLBILL_API_TAG_DEFINITIONS_PREFIX, { :audit => audit }, end |
.find_by_id(id, audit = 'NONE', options = {}) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/killbill_client/models/tag_definition.rb', line 20 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
28 29 30 |
# File 'lib/killbill_client/models/tag_definition.rb', line 28 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
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/killbill_client/models/tag_definition.rb', line 33 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
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/killbill_client/models/tag_definition.rb', line 45 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 |