class Nucleo::Models::ChangeTypes::Base
Public Class Methods
new(attributes={})
click to toggle source
Return an instance of the Rule Type domain model
@param attributes [Hash]
@return [Nucleo::Models::RuleType::Base]
# File lib/nucleo/models/change_types/base.rb, line 12 def initialize(attributes={}) @attributes = attributes end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/nucleo/models/change_types/base.rb, line 16 def <=>(other) self.created_at <=> other.created_at end
category()
click to toggle source
Returns the category of the rule
@return [String]
# File lib/nucleo/models/change_types/base.rb, line 51 def category @attributes['category'] end
context()
click to toggle source
Returns the context of the rule
@return [String]
# File lib/nucleo/models/change_types/base.rb, line 44 def context @attributes['context'] end
created_at()
click to toggle source
Returns the created at timestamp of the rule.
@return [DateTime]
# File lib/nucleo/models/change_types/base.rb, line 66 def created_at begin DateTime.parse(@attributes['created_at']) rescue nil end end
id()
click to toggle source
Returns the ID of the rule
@return [String]
# File lib/nucleo/models/change_types/base.rb, line 23 def id @attributes['id'] end
page_id()
click to toggle source
Returns the associated page id
@return [String]
# File lib/nucleo/models/change_types/base.rb, line 37 def page_id @attributes['page_id'] end
site_id()
click to toggle source
Returns the associated site id
@return [String]
# File lib/nucleo/models/change_types/base.rb, line 30 def site_id @attributes['site_id'] end
type()
click to toggle source
Returns the type of the rule
@return [String]
# File lib/nucleo/models/change_types/base.rb, line 58 def type @attributes['type'] end
Protected Instance Methods
rule()
click to toggle source
# File lib/nucleo/models/change_types/base.rb, line 75 def rule @attributes.fetch('rule', {}) end