Sha256: f58bcec7ef9b08860c998c54e60b22056ebed009baf586b304ae8362a554a78d

Contents?: true

Size: 486 Bytes

Versions: 23

Compression:

Stored size: 486 Bytes

Contents

require 'hiroshimarb/member'

module Hiroshimarb
  class DSL < BasicObject
    def initialize
      @members = []
    end

    def member(&block)
      @member = ::Hiroshimarb::Member.new
      @members << @member
      block.call if block
      @members
    end

    [:name, :github, :twitter, :website, :profile].each do |method_name|
      define_method method_name do |value|
        proxy_name = "#{method_name}="
        @member.send proxy_name, value
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
hiroshimarb-0.3.1 lib/hiroshimarb/dsl.rb
hiroshimarb-0.3.0 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.13 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.12 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.10 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.9 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.8 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.7 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.6 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.5 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.4 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.3 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.2 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.1 lib/hiroshimarb/dsl.rb
hiroshimarb-0.2.0 lib/hiroshimarb/dsl.rb
hiroshimarb-0.1.4 lib/hiroshimarb/dsl.rb
hiroshimarb-0.1.3 lib/hiroshimarb/dsl.rb
hiroshimarb-0.1.2 lib/hiroshimarb/dsl.rb
hiroshimarb-0.1.1 lib/hiroshimarb/dsl.rb
hiroshimarb-0.1.0 lib/hiroshimarb/dsl.rb