Class: Nucleo::Models::ChangeTypes::Base
- Inherits:
-
Object
- Object
- Nucleo::Models::ChangeTypes::Base
- Includes:
- Comparable
- Defined in:
- lib/nucleo/models/change_types/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#category ⇒ String
Returns the category of the rule.
-
#context ⇒ String
Returns the context of the rule.
-
#created_at ⇒ DateTime
Returns the created at timestamp of the rule.
-
#id ⇒ String
Returns the ID of the rule.
-
#initialize(attributes = {}) ⇒ Nucleo::Models::RuleType::Base
constructor
Return an instance of the Rule Type domain model.
-
#page_id ⇒ String
Returns the associated page id.
-
#site_id ⇒ String
Returns the associated site id.
-
#type ⇒ String
Returns the type of the rule.
Constructor Details
#initialize(attributes = {}) ⇒ Nucleo::Models::RuleType::Base
Return an instance of the Rule Type domain model
12 13 14 |
# File 'lib/nucleo/models/change_types/base.rb', line 12 def initialize(attributes={}) @attributes = attributes end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 |
# File 'lib/nucleo/models/change_types/base.rb', line 16 def <=>(other) self.created_at <=> other.created_at end |
#category ⇒ String
Returns the category of the rule
51 52 53 |
# File 'lib/nucleo/models/change_types/base.rb', line 51 def category @attributes['category'] end |
#context ⇒ String
Returns the context of the rule
44 45 46 |
# File 'lib/nucleo/models/change_types/base.rb', line 44 def context @attributes['context'] end |
#created_at ⇒ DateTime
Returns the created at timestamp of the rule.
66 67 68 69 70 71 72 |
# File 'lib/nucleo/models/change_types/base.rb', line 66 def created_at begin DateTime.parse(@attributes['created_at']) rescue nil end end |
#id ⇒ String
Returns the ID of the rule
23 24 25 |
# File 'lib/nucleo/models/change_types/base.rb', line 23 def id @attributes['id'] end |
#page_id ⇒ String
Returns the associated page id
37 38 39 |
# File 'lib/nucleo/models/change_types/base.rb', line 37 def page_id @attributes['page_id'] end |
#site_id ⇒ String
Returns the associated site id
30 31 32 |
# File 'lib/nucleo/models/change_types/base.rb', line 30 def site_id @attributes['site_id'] end |
#type ⇒ String
Returns the type of the rule
58 59 60 |
# File 'lib/nucleo/models/change_types/base.rb', line 58 def type @attributes['type'] end |