Sha256: dc0ae40ad495fe301b16266a680c5b04cbaea923b2e2df652584925929bbe54a

Contents?: true

Size: 550 Bytes

Versions: 1

Compression:

Stored size: 550 Bytes

Contents

require 'rubiks/nodes/annotated_node'
require 'rubiks/nodes/hierarchy'

module ::Rubiks

  class Level < ::Rubiks::AnnotatedNode
    def self.new_from_hash(hash={})
      new_instance = new
      return new_instance.from_hash(hash)
    end

    def from_hash(working_hash)
      return self if working_hash.nil?
      working_hash.stringify_keys!

      parse_name(working_hash.delete('name'))
      return self
    end

    def to_hash
      hash = {}

      hash['name'] = self.name.to_s if self.name.present?

      return hash
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubiks-0.0.4 lib/rubiks/nodes/level.rb