Class: Tebako::PackageDescriptor
- Inherits:
-
Object
- Object
- Tebako::PackageDescriptor
- Defined in:
- lib/tebako/package_descriptor.rb
Overview
Tebako application package descriptor
Constant Summary collapse
- SIGNATURE =
"TAMATEBAKO"
Instance Attribute Summary collapse
-
#cwd ⇒ Object
readonly
Returns the value of attribute cwd.
-
#entry_point ⇒ Object
readonly
Returns the value of attribute entry_point.
-
#mount_point ⇒ Object
readonly
Returns the value of attribute mount_point.
-
#ruby_version_major ⇒ Object
readonly
Returns the value of attribute ruby_version_major.
-
#ruby_version_minor ⇒ Object
readonly
Returns the value of attribute ruby_version_minor.
-
#ruby_version_patch ⇒ Object
readonly
Returns the value of attribute ruby_version_patch.
-
#tebako_version_major ⇒ Object
readonly
Returns the value of attribute tebako_version_major.
-
#tebako_version_minor ⇒ Object
readonly
Returns the value of attribute tebako_version_minor.
-
#tebako_version_patch ⇒ Object
readonly
Returns the value of attribute tebako_version_patch.
Instance Method Summary collapse
-
#initialize(*args) ⇒ PackageDescriptor
constructor
A new instance of PackageDescriptor.
- #serialize ⇒ Object
Constructor Details
#initialize(*args) ⇒ PackageDescriptor
Returns a new instance of PackageDescriptor.
38 39 40 41 42 43 44 45 46 |
# File 'lib/tebako/package_descriptor.rb', line 38 def initialize(*args) if args.size == 1 && args[0].is_a?(Array) deserialize(args[0]) elsif args.size == 5 construct_from_params(*args) else raise ArgumentError, "Invalid arguments" end end |
Instance Attribute Details
#cwd ⇒ Object (readonly)
Returns the value of attribute cwd.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def cwd @cwd end |
#entry_point ⇒ Object (readonly)
Returns the value of attribute entry_point.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def entry_point @entry_point end |
#mount_point ⇒ Object (readonly)
Returns the value of attribute mount_point.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def mount_point @mount_point end |
#ruby_version_major ⇒ Object (readonly)
Returns the value of attribute ruby_version_major.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def ruby_version_major @ruby_version_major end |
#ruby_version_minor ⇒ Object (readonly)
Returns the value of attribute ruby_version_minor.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def ruby_version_minor @ruby_version_minor end |
#ruby_version_patch ⇒ Object (readonly)
Returns the value of attribute ruby_version_patch.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def ruby_version_patch @ruby_version_patch end |
#tebako_version_major ⇒ Object (readonly)
Returns the value of attribute tebako_version_major.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def tebako_version_major @tebako_version_major end |
#tebako_version_minor ⇒ Object (readonly)
Returns the value of attribute tebako_version_minor.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def tebako_version_minor @tebako_version_minor end |
#tebako_version_patch ⇒ Object (readonly)
Returns the value of attribute tebako_version_patch.
35 36 37 |
# File 'lib/tebako/package_descriptor.rb', line 35 def tebako_version_patch @tebako_version_patch end |
Instance Method Details
#serialize ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/tebako/package_descriptor.rb', line 48 def serialize buffer = StringIO.new buffer.write(SIGNATURE) serialize_versions(buffer) write_string(buffer, @mount_point) write_string(buffer, @entry_point) serialize_cwd(buffer) buffer.string end |