Sha256: a009097d0e14a124a34e7ffe02aeba0df7b9b476d7c9905cb35aa78cd51bbe63

Contents?: true

Size: 557 Bytes

Versions: 13

Compression:

Stored size: 557 Bytes

Contents

module Finix
  module HalResource

    attr_accessor :hyperlinks
    attr_accessor :attributes

    def method_missing(method, *args, &block)
      if @attributes.has_key?(method.to_s)
        return @attributes[method.to_s]
      end

      case method.to_s
        when /(.+)=$/
          attr = method.to_s.chop
          @attributes[attr] = args[0]
        else
          if @hyperlinks.has_key? "#{method}"
            value = @hyperlinks["#{method}"]
            result = value.call
            return result
          end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
finix-0.15 lib/finix/hal_resource.rb
finix-0.14 lib/finix/hal_resource.rb
finix-0.13 lib/finix/hal_resource.rb
finix-0.12 lib/finix/hal_resource.rb
finix-0.11 lib/finix/hal_resource.rb
finix-0.10 lib/finix/hal_resource.rb
finix-0.9 lib/finix/hal_resource.rb
finix-0.8 lib/finix/hal_resource.rb
finix-0.7 lib/finix/hal_resource.rb
finix-0.6 lib/finix/hal_resource.rb
finix-0.5 lib/finix/hal_resource.rb
finix-0.4 lib/finix/hal_resource.rb
finix-0.3 lib/finix/hal_resource.rb