Class: Txbr::Metadata
- Inherits:
-
Object
- Object
- Txbr::Metadata
- Defined in:
- lib/txbr/metadata.rb
Constant Summary collapse
- ASSIGNMENTS =
%w(project_slug resource_slug prefix)
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#project_slug ⇒ Object
readonly
Returns the value of attribute project_slug.
-
#resource_slug ⇒ Object
readonly
Returns the value of attribute resource_slug.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(options = {}) ⇒ Metadata
constructor
A new instance of Metadata.
Constructor Details
#initialize(options = {}) ⇒ Metadata
Returns a new instance of Metadata.
7 8 9 10 11 |
# File 'lib/txbr/metadata.rb', line 7 def initialize( = {}) @project_slug = ['project_slug'] @resource_slug = ['resource_slug'] @prefix = ['prefix'] end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
5 6 7 |
# File 'lib/txbr/metadata.rb', line 5 def prefix @prefix end |
#project_slug ⇒ Object (readonly)
Returns the value of attribute project_slug.
5 6 7 |
# File 'lib/txbr/metadata.rb', line 5 def project_slug @project_slug end |
#resource_slug ⇒ Object (readonly)
Returns the value of attribute resource_slug.
5 6 7 |
# File 'lib/txbr/metadata.rb', line 5 def resource_slug @resource_slug end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 16 17 |
# File 'lib/txbr/metadata.rb', line 13 def ==(other) project_slug == other.project_slug && resource_slug == other.resource_slug && prefix == prefix end |
#eql?(other) ⇒ Boolean
19 20 21 |
# File 'lib/txbr/metadata.rb', line 19 def eql?(other) hash == other.hash end |
#hash ⇒ Object
23 24 25 26 27 28 |
# File 'lib/txbr/metadata.rb', line 23 def hash h = 7 h = 31 * h + project_slug.hash h = 31 * h + resource_slug.hash h = 31 * h + prefix.hash end |